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

Commit

Permalink
Fix 1014 (#1017)
Browse files Browse the repository at this point in the history
* added basic translations for report

* feat: added report model

* feat: added report tabs to visit page

* feat: added report route to router

* feat: added report page

* feat: reports to visits children

* feat: added add/delete report capabilities

* fix: fixed diagnosisContainer issue on browser back history button

* fix: display different report title based on type of visit

* Modified Package.json for new NPM Deployment

* fix: added next appointment and operative plans to opd form

* Restore package.json to working state

* Implement custom forms for OPD Report

* Add custom forms attribute to report model

* fix: saved report object

* fix: added preview report feat

* fix: added report by visit view

* fix: added logic to show different report sections

* fix: added some report translations

* fix: edited report model

* fix: implemented logic to toggle between show report and new report

* Remove preview functionality from OPD Reports

* Implement print button

* Remove print section header

* Write styles and markup for print page

* Refactor report header into partial

* Rename report types

* fix style lint errors

* fix: completed internationalization and lint fix

* 0.9.18

* Incremented version number, added scope

* fix: remove patientId field, fixed next appointment bug, removed unused translation

* fix: change date fields to simple text

* fix: fixed bug that has to do with page header title

* Added .travis.yml file for building and deploying to npm

* Removed ember test. Pretty much does the same as npm test

* Allowing all branches to be tested and built

* fix: added translations for discharge report

* fix: modified report model to accommodate discharge report

* fix: added discharge report

* fix: added next appointment date to discharge report on save

* fix: implemented next appointment as a mixin

* fix: added translations for followup appointment message

* fix: made sure a followup appointment exists before you generate discharge report

* Add Hospital Info report header as option config

* Add report model to patient-diagnosis and visit unit tests

* fix: fixed report header conflict

* Refactor report template

* Add custom forms to discharge report

* fix: added hospital info doc to environment

* fix: create sample docs on couchdb

* Change how "new" routes work

Makes sure that if user redirects to url the patient is properly
selected.

* fix: made sure sample docs are created when deleted

* Add query parameters to improve app navigation experience

* set patient on visit models

* Redirect reports/new to patients when no visit model

* Clean up visit controller

* Set visit on models

* Update visit acceptance tests

* Fix appointments new surgery test error

* Remove double reference to visits controller

* Display visit diagnosis appropriately

* Fix Operative Plans display

* fix: fixed translation lables for next appointments

* fix: modified get futureAppointment to work for list of appointments

* fix: implemented next appointments on both template and controller

* fix: fix lint

* FIx next appointments display

* Added auto trigger hospitalrun-server refresh script on successful build

* Fix reports controller bug

* Add diagnosis container

* Set patient on model if model is not new

* Set visit on controller and add display current operative plan

* Add `Completed By` field to report

* Refactor reports template

* Ensure reports.edit returns to visits.edit

* Display patient procedures on report

* Remove discharge report compulsory next appointment modal

* Fix `completed by` on report page

* Style select element properly; Add titles to report

* fix: fix  new user title bug after a new user has been added

* Added deploy branches to .travis.yml

* fix: fix  test for new user title bug

* fix: updated report template with testing attributes on fields

* fix: update visit template with testing attributes on fields

* fix: implemented acceptance tests for opd and discharge reports

* Implement acceptance tests for OPD Report

* Refactor code to conform with style guide

* Fix nextAppointment bug

* change edit to view; add print button on visit page

* Merge remote-tracking branch 'upstream/master' into fix-996

* Add new fields to OPD Report

* Remove old code

* Refactor localization strings

* Update template.hbs

* Change print-this component

* Replace surgeon lookuplist with value from visit examiner

* Change examiner label; remove hard-coded date-format
  • Loading branch information
adeolabadmus authored and jkleinsc committed Mar 23, 2017
1 parent be8201c commit ae68dae
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 42 deletions.
2 changes: 1 addition & 1 deletion app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ export default {
author: 'Author'
},
visitType: 'Visit Type',
examiner: 'Visit Examiner',
examiner: 'Examiner',
location: 'Visit Location',
primaryDiagnosis: 'Primary Diagnosis',
secondaryDiagnosis: 'Secondary Diagnosis',
Expand Down
10 changes: 0 additions & 10 deletions app/models/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export default AbstractModel.extend({
reportDate: DS.attr('date'),
customForms: DS.attr('custom-forms'),
reportType: DS.attr('string'),
surgeon: DS.attr('string'),

// Associations
visit: DS.belongsTo('visit', { async: false }),
Expand All @@ -18,15 +17,6 @@ export default AbstractModel.extend({

reportDate: {
presence: true
},

surgeon: {
presence: {
'if'(object) {
return !object.get('visit.outPatient');
},
message: 'Please select a surgeon'
}
}
}
});
6 changes: 0 additions & 6 deletions app/visits/reports/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ export default AbstractEditController.extend(PatientSubmodule, PatientDiagnosis,
queryParams: ['print'],
print: null,

lookupListsToUpdate: [{
name: 'physicianList',
property: 'model.surgeon',
id: 'physician_list'
}],

visitsController: Ember.inject.controller('visits'),

physicianList: alias('visitsController.physicianList'),
Expand Down
23 changes: 11 additions & 12 deletions app/visits/reports/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{{t 'reports.labels.admissionDate' }}:
{{/if}}
</label>
<span class="test-visit-date-data">{{date-format visit.startDate format="DD/MM/YYYY"}}</span>
<span class="test-visit-date-data">{{date-format visit.startDate}}</span>
</div>

{{#if isOutPatient}}
Expand Down Expand Up @@ -117,7 +117,7 @@
<ul>
{{#each nextAppointments as |appointment|}}
<li class="test-appointment-data">
{{date-format appointment.startDate format="DD/MM/YYYY hh:mm a"}}
{{date-format appointment.startDate}}
{{#if appointment.appointmentType}}
(<b>{{appointment.appointmentType}}</b>)
{{/if}}
Expand Down Expand Up @@ -178,24 +178,23 @@

<div class="ps-info-group test-visit-date">
<label class="ps-info-label test-visit-discharge-date-label">{{t 'reports.labels.dischargeDate' }}: </label>
<span class="test-visit-discharge-date-data">{{date-format model.reportDate format="DD/MM/YYYY"}}</span>
<span class="test-visit-discharge-date-data">{{date-format model.reportDate}}</span>
</div>

<div class="row">
{{select-or-typeahead className="col-sm-4" property="surgeon"
label=(t "operativePlan.labels.surgeon") list=physicianList
selection=model.surgeon
class="plan-surgeon"
}}
</div>
{{#if visit.examiner }}
<div class="ps-info-group test-examiner">
<p><b class="test-examiner-label">{{t 'reports.labels.examiner' }}:</b>
<span class="test-examiner-data">{{visit.examiner}}</span></p>
</div>
{{/if}}

{{#if patientProcedures}}
<label class="ps-info-label">{{t 'reports.labels.allProcedures'}}</label>
<ul>
{{#each patientProcedures as |procedure|}}
<li>{{procedure.description}} -
{{#if procedure.procedureDate }}
{{date-format procedure.procedureDate format="DD/MM/YYYY"}}
{{date-format procedure.procedureDate}}
{{/if}}</li>
{{/each}}
</ul>
Expand All @@ -219,7 +218,7 @@
{{#if nextAppointment}}
<div class="ps-info-group">
<label class="ps-info-label">{{t 'reports.labels.nextAppointment' }}:</label>
{{date-format nextAppointment.startDate format="DD/MM/YYYY hh:mm a"}}
{{date-format nextAppointment.startDate}}
{{#if nextAppointment.location}}
({{nextAppointment.location}})
{{/if}}
Expand Down
18 changes: 5 additions & 13 deletions tests/acceptance/visit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const visitData = {
NOTE_CONTENT: 'OPD notes are entered here'
},
admission: {
EXAMINER: 'Drederick Willie',
NOTE_CONTENT: 'Patient notes are entered here'
}
};
Expand Down Expand Up @@ -342,6 +343,7 @@ function addOutpatientData(assert) {
}

function addAdmissionData(assert) {
typeAheadFillIn('.visit-examiner', visitData.admission.EXAMINER);
andThen(function() {
click('[data-test-selector=notes-tab]');
waitToAppear('[data-test-selector=new-note-btn]');
Expand Down Expand Up @@ -382,7 +384,7 @@ function checkOPDReport(assert) {
assert.ok(!isEmpty(find('.test-visit-date .test-visit-date-data').text()), 'Visit date is displayed');
findWithAssert('.test-visit-type .test-visit-type-label:contains(Visit Type)');
assert.equal(find('.test-visit-type .test-visit-type-data').text(), 'Clinic', 'Visit Type is displayed');
findWithAssert('.test-examiner .test-examiner-label:contains(Visit Examiner)');
findWithAssert('.test-examiner .test-examiner-label:contains(Examiner)');
assert.equal(find('.test-examiner .test-examiner-data').text(), visitData.outPatient.EXAMINER, 'Visit Examiner is displayed');
findWithAssert('.test-location .test-location-label:contains(Visit Location)');
assert.equal(find('.test-location .test-location-data').text(), visitData.outPatient.LOCATION, 'Visit Location is displayed');
Expand All @@ -406,23 +408,13 @@ function checkOPDReport(assert) {

function checkDischargeReport(assert) {
andThen(function() {
findWithAssert('.test-examiner .test-examiner-label:contains(Examiner)');
assert.equal(find('.test-examiner .test-examiner-data').text(), visitData.admission.EXAMINER, 'Examiner is displayed');
assert.equal(find('.test-visit-date .test-visit-date-label').text().trim(), 'Admission Date:', 'Visit date label displays as admission');
assert.equal(find('.test-visit-date .test-visit-discharge-date-label').text().trim(), 'Discharge Date:', 'Discharge date label displays');
findWithAssert('.test-notes .test-notes-label:contains(Notes)');
assert.ok(find('.test-notes .test-notes-data').text().indexOf(visitData.admission.NOTE_CONTENT) > -1, 'Notes are displayed');
});
andThen(function() {
click('.panel-footer button:contains(Add)');
waitToAppear('.modal-dialog');
});
andThen(function() {
assert.equal(find('.modal-title').text(), 'Warning!!!!', 'Cant save discharge report without entering doctors name');
click('button:contains(Ok)');
waitToDisappear('.modal-dialog');
});
andThen(function() {
typeAheadFillIn('.plan-surgeon', 'Dr Test');
});
}

function saveReport(assert, type) {
Expand Down

0 comments on commit ae68dae

Please sign in to comment.