Skip to content

RA-2095: O2 Patient Header should support multiple patient identifier…#523

Merged
mogoodrich merged 2 commits intomasterfrom
RA-2095
Mar 19, 2026
Merged

RA-2095: O2 Patient Header should support multiple patient identifier…#523
mogoodrich merged 2 commits intomasterfrom
RA-2095

Conversation

@mogoodrich
Copy link
Member

… locations when creating a patient identifier

… 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() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes needing when upgrading to the latest snapshot of EMR-API

@mogoodrich mogoodrich requested a review from mseaton March 18, 2026 18:32
@mogoodrich
Copy link
Member Author

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, will fix.

patientIdentifier.setLocation(medicalRecordLocation);
}
else {
log.warn("Unable to set patient identifier location");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@mseaton mseaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments @mogoodrich to review and consider

… locations when creating a patient identifier
@mogoodrich mogoodrich merged commit e000944 into master Mar 19, 2026
4 checks passed
@mogoodrich mogoodrich deleted the RA-2095 branch March 19, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants