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

Commit

Permalink
Cleaned up patient history
Browse files Browse the repository at this point in the history
Resolves #889
  • Loading branch information
jkleinsc committed Dec 27, 2016
1 parent 51a246a commit 4db8c13
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 36 deletions.
19 changes: 18 additions & 1 deletion app/models/visit.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const PAYMENT_STATES = {
CLEAR: 'clear',
PENDING: 'pending'
};
const COMPLETED_STATUS = 'Completed';
const FULFILLED_STATUS = 'Fulfilled';
const REQUESTED_STATUS = 'Requested';
const STATUS_FIELD = 'status';

Expand Down Expand Up @@ -86,7 +88,22 @@ export default AbstractModel.extend({
}
}),

hasDoneOrders: computed('labs', 'imaging', function() {
hasCompletedImaging: computed('[email protected]', function() {
let imaging = this.get('imaging');
return imaging.isAny(STATUS_FIELD, COMPLETED_STATUS);
}),

hasCompletedLabs: computed('[email protected]', function() {
let labs = this.get('labs');
return labs.isAny(STATUS_FIELD, COMPLETED_STATUS);
}),

hasCompletedMedication: computed('[email protected]', function() {
let medication = this.get('medication');
return medication.isAny(STATUS_FIELD, FULFILLED_STATUS);
}),

hasDoneOrders: computed('[email protected]', '[email protected]', function() {
let i18n = this.get('i18n');
let imaging = this.get('imaging');
let labs = this.get('labs');
Expand Down
49 changes: 14 additions & 35 deletions app/patients/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -46,67 +46,46 @@
<div class="ph-note-item">
<h5 class="ph-note-heading">{{t 'labels.procedures' }}</h5>
{{#each visit.procedures as |procedure|}}
<div {{action 'editProcedure' procedure }}>
<div {{action 'editProcedure' procedure }} class="clickable">
<h5 class="ph-note-heading">
{{date-format procedure.procedureDate}}:
{{#if procedure.cptCode}}
[{{t 'labels.cptcode' }} - {{procedure.cptCode}}]
{{/if}}
{{procedure.description}}
</h5>
<h6>
{{t 'labels.physician'}}: {{procedure.physician}}
{{#if procedure.assistant}}
, {{t 'labels.assisting'}}: {{procedure.assistant}}
{{/if}}
{{#if procedure.anesthesiologist}}
, {{t 'labels.anesthesia'}}: {{procedure.anesthesiologist}}
{{/if}}
</h6>
{{html-line-break procedure.notes}}
</div>
{{/each}}
</div>
{{/if}}
{{#if visit.imaging}}
{{#if visit.hasCompletedImaging}}
<div class="ph-note-item">
<h5 class="ph-note-heading">{{t 'labels.imageOrders' }}</h5>
{{#each visit.imaging as |imaging|}}
<div {{action 'editImaging' imaging }}>
{{#if (eq imaging.status 'Completed')}}
<h5 class="ph-note-heading">{{date-format imaging.imagingDate}}: {{imaging.imagingType.name}}</h5>
<div>{{imaging.result}}</div>
<div>{{html-line-break imaging.notes}}</div>
</div>
{{/if}}
{{/each}}
</div>
{{/if}}
{{#if visit.labs}}
{{#if visit.hasCompletedLabs}}
<div class="ph-note-item">
<h5 class="ph-note-heading">{{t 'labels.labOrders' }}</h5>
{{#each visit.labs as |lab|}}
<div {{action 'editLab' lab }}>
{{#if (eq lab.status 'Completed')}}
<h5 class="ph-note-heading">{{date-format lab.labDate}}: {{lab.labType.name}}</h5>
<div>{{lab.result}}</div>
<div>{{html-line-break lab.notes}}</div>
</div>
{{/if}}
{{/each}}
</div>
{{/if}}
{{#if visit.patientNotes}}
{{#if visit.hasCompletedMedication}}
<div class="ph-note-item">
<h5 class="ph-note-heading">{{t 'labels.notes'}}</h5>
{{#each visit.patientNotes as |note|}}
<div {{action 'showAddPatientNote' note }}>
<h5 class="ph-note-heading">{{note.authoredBy}}</h5>
{{date-format note.date}}[{{note.noteType}}]: {{html-line-break note.content}}
</div>
<h5 class="ph-note-heading">{{t 'labels.medication' }}</h5>
{{#each visit.medication as |medication|}}
{{#if (eq medication.status 'Fulfilled')}}
<h5 class="ph-note-heading">{{date-format medication.prescriptionDate}}: {{medication.medicationName}}</h5>
{{/if}}
{{/each}}
</div>
{{else}}
<div class="ph-note-item">
{{t 'messages.noNotesAvailable'}}
</div>
{{/if}}

</div>
{{/each}}
{{else}}
Expand Down

0 comments on commit 4db8c13

Please sign in to comment.