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

Commit

Permalink
Issue 661: Use 'Sex Not Entered' for patients with missing gender on … (
Browse files Browse the repository at this point in the history
#662)

* Issue 661: Use 'Sex Not Entered' for patients with missing gender on reports

* Issue 661: move 'Sex Not Entered' to localization file.
  • Loading branch information
akong authored and jkleinsc committed Sep 27, 2016
1 parent 6c2a37c commit f8af165
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,8 @@ export default {
referredDate: 'Referred Date',
religion: 'Religion',
parent: 'Parent/Guardian',
contacts: 'Contacts'
contacts: 'Contacts',
sexNotEntered: 'Sex Not Entered'
},
notes: {
newNote: 'New Note for',
Expand Down
12 changes: 9 additions & 3 deletions app/patients/reports/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,9 @@ export default AbstractReportController.extend(PatientDiagnosis, PatientVisits,
_generateAdmissionOrDischargeReport: function(visits, reportType) {
var detailedReport = false,
reportColumns,
patientBySex = {};
patientBySex = {},
sexNotEnteredLabel = this.get('i18n').t('patients.labels.sexNotEntered');

if (reportType.indexOf('detailed') > -1) {
detailedReport = true;
reportColumns = this.get('admissionDetailReportColumns');
Expand All @@ -568,13 +570,17 @@ export default AbstractReportController.extend(PatientDiagnosis, PatientVisits,
admissionDate: visit.get('startDate'),
dischargeDate: visit.get('endDate')
};
var sexGrouping = patientBySex[visit.get('patient.sex')];
var sex = visit.get('patient.sex');
if (!sex) {
sex = sexNotEnteredLabel;
}
var sexGrouping = patientBySex[sex];
if (!sexGrouping) {
sexGrouping = {
count: 0,
rows: []
};
patientBySex[visit.get('patient.sex')] = sexGrouping;
patientBySex[sex] = sexGrouping;
}
sexGrouping.count++;
sexGrouping.rows.push(reportRow);
Expand Down

0 comments on commit f8af165

Please sign in to comment.