Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Add requesting clinician to Labs
Browse files Browse the repository at this point in the history
  • Loading branch information
clettenberg committed May 13, 2016
1 parent e36dc73 commit 7a502d5
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 21 deletions.
5 changes: 5 additions & 0 deletions app/labs/completed/labs-completed-list-item/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Ember from 'ember';

export default Ember.Component.extend({
tagName: 'tr'
});
7 changes: 7 additions & 0 deletions app/labs/completed/labs-completed-list-item/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<td class="requested-date">{{date-format lab.requestedDate}}</td>
<td class="lab-date">{{date-format lab.labDate}}</td>
<td class="patient">{{lab.patient.displayName}}</td>
<td class="requested-by">{{lab.requestedBy}}</td>
<td class="lab-type">{{lab.labType.name}}</td>
<td class="result">{{lab.result}}</td>
<td class="notes">{{lab.notes}}</td>
10 changes: 2 additions & 8 deletions app/labs/completed/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@
<th>{{t 'labels.date_requested'}}</th>
<th>{{t 'labels.date_completed'}}</th>
<th>{{t 'labels.patient'}}</th>
<th>{{t 'labels.requested_by'}}</th>
<th>{{t 'labs.labels.lab_type'}}</th>
<th>{{t 'labels.results'}}</th>
<th>{{t 'labels.notes'}}</th>
</tr>
{{#each model as |lab|}}
<tr>
<td>{{date-format lab.requestedDate}}</td>
<td>{{date-format lab.labDate}}</td>
<td>{{lab.patient.displayName}}</td>
<td>{{lab.labType.name}}</td>
<td>{{lab.result}}</td>
<td>{{lab.notes}}</td>
</tr>
{{labs/completed/labs-completed-list-item lab=lab}}
{{/each}}
</table>
{{else}}
Expand Down
4 changes: 4 additions & 0 deletions app/labs/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
<label>{{t 'labs.labels.lab_type'}}</label>
<p class="form-control-static">{{model.labType.name}}</p>
</div>
<div class="form-group col-xs-9">
<label>{{t 'labels.requested_by'}}</label>
<p class="form-control-static">{{model.requestedBy}}</p>
</div>
</div>
{{/if}}
{{#if canComplete}}
Expand Down
6 changes: 6 additions & 0 deletions app/labs/index/labs-edit-button/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import Ember from 'ember';

export default Ember.Component.extend({
tagName: 'button',
classNames: ['btn', 'btn-default', 'neutral']
});
1 change: 1 addition & 0 deletions app/labs/index/labs-edit-button/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{#link-to 'labs.edit' lab}}{{t 'labels.edit'}}{{/link-to}}
10 changes: 10 additions & 0 deletions app/labs/index/labs-list-item/component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Ember from 'ember';

export default Ember.Component.extend({
tagName: 'tr',
classNames: ['clickable'],

click() {
this.sendAction('action', this.lab);
}
});
12 changes: 12 additions & 0 deletions app/labs/index/labs-list-item/template.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<td class="requested-date">{{date-format lab.requestedDate}}</td>
<td class="patient">{{lab.patient.displayName}}</td>
<td class="requested-by">{{lab.requestedBy}}</td>
<td class="lab-type">{{lab.labType.name}}</td>
<td class="notes">{{lab.notes}}</td>
{{#if showActions}}
<td>
{{#if canEdit}}
{{labs/index/labs-edit-button lab=lab}}
{{/if}}
</td>
{{/if}}
19 changes: 6 additions & 13 deletions app/labs/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,19 @@
<tr class="table-header">
<th>{{t 'labels.date_requested'}}</th>
<th>{{t 'labels.patient'}}</th>
<th>{{t 'labels.requested_by'}}</th>
<th>{{t 'labs.labels.lab_type'}}</th>
<th>{{t 'labels.notes'}}</th>
{{#if showActions}}
<th>{{t 'labels.actions'}}</th>
{{/if}}
</tr>
{{#each model as |lab|}}
<tr {{action 'editItem' lab}} class="clickable">
<td>{{date-format lab.requestedDate}}</td>
<td>{{lab.patient.displayName}}</td>
<td>{{lab.labType.name}}</td>
<td>{{lab.notes}}</td>
{{#if showActions}}
<td>
{{#if canEdit}}
<button class="btn btn-default neutral" {{action 'editItem' lab bubbles=false }}>{{t 'labels.edit'}}</button>
{{/if}}
</td>
{{/if}}
</tr>
{{labs/index/labs-list-item
lab=lab
action='editItem'
showActions=showActions
canEdit=canEdit}}
{{/each}}
</table>
{{else}}
Expand Down
1 change: 1 addition & 0 deletions app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@import 'components/tab_content';
@import 'components/patient_summary';
@import 'components/patient_history';
@import 'components/labs';

// NOTE: do not place styles in this file
// If you have styles to add, put them in
Expand Down
1 change: 1 addition & 0 deletions app/styles/components/_labs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.notes { max-width: 300px; }

0 comments on commit 7a502d5

Please sign in to comment.