RA-2095: O2 Patient Header should support multiple patient identifier…#523
RA-2095: O2 Patient Header should support multiple patient identifier…#523mogoodrich merged 2 commits intomasterfrom
Conversation
… locations when creating a patient identifier
| @@ -13,7 +13,12 @@ public class CoreAppsProperties extends ModuleProperties { | |||
|
|
|||
| // when adding a new patient identifier via the patient dashboard, the location to use if not specified (and the identifier type requires a location) | |||
| public Location getDefaultPatientIdentifierLocation() { | |||
There was a problem hiding this comment.
Changed so that exception won't be thrown if GP is not defined.
| Date today = new DateTime().toDate(); | ||
| controller.setDuration(visitService, administrationService, visit, startDate, today, request, mock(UiUtils.class)); | ||
|
|
||
| assertThat(savedVisit().getStopDatetime(), sameInstant(today)); |
There was a problem hiding this comment.
Fixes needing when upgrading to the latest snapshot of EMR-API
|
This will require the change in EMR-API-229, will re-run this build once that goes through. |
| if (patientIdentifier.getLocation() == null | ||
| && !PatientIdentifierType.LocationBehavior.NOT_USED.equals(patientIdentifier.getIdentifierType().getLocationBehavior())) { | ||
| patientIdentifier.setLocation(coreAppsProperties.getDefaultPatientIdentifierLocation()); | ||
| if (coreAppsProperties.getDefaultPatientIdentifierLocation() != null) { |
There was a problem hiding this comment.
Nit, but I would try to just invoke this method once, and use the result for both null checking and setting, rather than retrieve it twice.
| patientIdentifier.setLocation(medicalRecordLocation); | ||
| } | ||
| else { | ||
| log.warn("Unable to set patient identifier location"); |
There was a problem hiding this comment.
Presumably this should throw an exception rather than warn, since this is an invalid state, and would end up just failing validation below with a less specific error message?
There was a problem hiding this comment.
I kind of liked the idea of this just throwing a warning, in case the underlying the validation is ever changed. We do log a warning to help with debugging when it does occur.
mseaton
left a comment
There was a problem hiding this comment.
A few comments @mogoodrich to review and consider
… locations when creating a patient identifier
… locations when creating a patient identifier