Skip to content

Commit

Permalink
For the MPI search, show required information #7 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
stansL authored Mar 29, 2021
1 parent 4aa8871 commit 047558d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions api/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ coreapps.findPatient.search.button=Search
coreapps.findPatient.result.view=View
coreapps.age.months={0} Month(s)
coreapps.age.days={0} Day(s)
coreapps.patient.source=Patient Source

coreapps.patientDashBoard.editPatientIdentifier.duplicateMessage=is already in use
coreapps.patientDashBoard.editPatientIdentifier.invalidMessage=did not pass validation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
birthdate:"${ it.birthdate ? ui.escapeJs(ui.encodeHtmlContent(dateFormatter.format(it.birthdate))) : '' }",
// it.birthdateEstimated is of type boolean (doesn't need sanitization)
birthdateEstimated: ${ it.birthdateEstimated },
patientAddress: "${ it.personAddress.cityVillage }" ,
identifier:"${ it.patientIdentifier ? ui.escapeJs(ui.encodeHtmlContent(it.patientIdentifier.identifier)) : '' }",
widgetBirthdate:"${ it.birthdate ? ui.escapeJs(ui.encodeHtmlContent(searchWidgetDateFormatter.format(it.birthdate))) : '' }"
}
Expand Down Expand Up @@ -76,8 +77,10 @@
genderColHeader: '${ ui.message("coreapps.gender") }',
ageColHeader: '${ ui.message("coreapps.age") }',
birthdateColHeader: '${ ui.message("coreapps.birthdate") }',
addressColHeader: '${ ui.message("coreapps.person.address") }',
ageInMonths: '${ ui.message("coreapps.age.months") }',
ageInDays: '${ ui.message("coreapps.age.days") }',
sourceColHeader: '${ ui.message("coreapps.patient.source") }',
actionColHeader: '${ ui.message("coreapps.action") }'
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ function MpiPatientSearchWidget(configuration) {
'<th>' + config.messages.genderColHeader + '</th>' +
'<th>' + config.messages.ageColHeader + '</th>' +
'<th>' + config.messages.birthdateColHeader + '</th>' +
'<th>' + config.messages.actionColHeader + '</th>' +
'<th>'+config.messages.addressColHeader+'</th>'+
attributeHeaders +
'<th>' + config.messages.sourceColHeader + '</th>' +
'<th>' + config.messages.actionColHeader + '</th>' +
'</tr>' +
'</thead>' +
'<tbody></tbody>' +
Expand Down Expand Up @@ -219,7 +221,8 @@ function MpiPatientSearchWidget(configuration) {
var identifier = patient.identifiers[0].value;
var age = 12;
var patientName = patient.givenName + ' ' + patient.familyName;
var dataRow = [identifier, patientName, patient.gender, age, birthdate,'<button class="'+ identifier + '" style="float:right; margin:10px; padding: 2px 8px"><i class=""></i>Import and Open</button>'];
var action = '<button class="'+ identifier + '" style="float:right; margin:10px; padding: 2px 8px" disabled><i class=""></i>Import</button>'
var dataRow = [identifier, patientName, patient.gender, age, birthdate,patient.personAddress,patient.mothersName,patient.phoneNumber,patient.sourceLocation,action];
dataRows.push(dataRow);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function PatientSearchWidget(configuration){
'<th>'+config.messages.genderColHeader+'</th>'+
'<th>'+config.messages.ageColHeader+'</th>'+
'<th>'+config.messages.birthdateColHeader+'</th>'+
'<th>'+config.messages.addressColHeader+'</th>'+
attributeHeaders+
'</tr>'+
'</thead>'+
Expand Down Expand Up @@ -94,8 +95,9 @@ function PatientSearchWidget(configuration){
if(age == '' && widgetBirthdate != ''){
age = formatAge(widgetBirthdate);
}
var shortAddress = p.patientAddress;
var initialPatient = [p.identifier+" <span class='recent-lozenge'>"+config.messages.recent+"</span>",
p.name, p.gender, age, bdate];
p.name, p.gender, age, bdate, shortAddress];
jq.each(attributeTypes, function(key, attributeTypeName){
initialPatient.push(p[attributeTypeName]);
});
Expand All @@ -118,7 +120,7 @@ function PatientSearchWidget(configuration){
var keyboardControlKeys = [16,17,18,20,27,35,36,37,39,91,93,224];
var customRep = 'custom:(patientId,uuid,' +
'patientIdentifier:(uuid,identifier),' +
'person:(gender,age,birthdate,birthdateEstimated,personName),' +
'person:(gender,age,birthdate,birthdateEstimated,personName,personAddress),' +
'attributes:(value,attributeType:(name)))';

var doSearch = function(query, currRequestCount, autoSelectIfExactIdentifierMatch){
Expand Down Expand Up @@ -270,7 +272,7 @@ function PatientSearchWidget(configuration){
age = formatAge(widgetBirthdate);
}
var dataRow = [identifier, patient.person.personName.display, patient.person.gender,
age, birthdate];
age, birthdate, patient.person.personAddress.display];
jq.each(attributeTypes, function(index, typeName){
var attributeValue = "";
jq.each(patient.attributes, function(index, attribute) {
Expand Down

0 comments on commit 047558d

Please sign in to comment.