Skip to content

Commit 90aff4e

Browse files
authored
switch from IsantePlus ID to Isante ID (#65)
1 parent d576343 commit 90aff4e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

api/src/main/java/org/openmrs/module/labintegration/api/LabIntegrationReportsConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public final class LabIntegrationReportsConstants {
1010

1111
public static final String LOCATION_ISANTE_CODE_UUID = "0e52924e-4ebb-40ba-9b83-b198b532653b";
1212

13-
public static final String ISANTEPLUS_IDENDTIFIER_TYPE_UUID = "05a29f94-c0ed-11e2-94be-8c13b969e334";
13+
public static final String ISANTEPLUS_IDENDTIFIER_TYPE_UUID = "0e0c7cc2-3491-4675-b705-746e372ff346";
1414

1515
private LabIntegrationReportsConstants() {
1616
}

api/src/main/java/org/openmrs/module/labintegration/api/reports/LabResultDataSetEvaluator.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ public DataSet evaluate(DataSetDefinition dataSetDefinition, EvaluationContext e
9999
value = obs.getPerson().getPersonName().getFullName();
100100
break;
101101
case COLUMN_ISANTEPLUS_ID:
102-
value = getPatientIdentifier(obs.getPersonId());
102+
String locationCode = locationCodeCache.containsKey(obs.getEncounter().getLocation())
103+
? locationCodeCache.get(obs.getEncounter().getLocation())
104+
: "";
105+
value = getPatientIdentifier(obs.getPersonId(), locationCode);
103106
break;
104107
case COLUMN_DATE_ORDERED:
105108
value = obs.getEncounter().getEncounterDatetime();
@@ -147,12 +150,12 @@ protected String extractLocationCode(Obs obs, Map<Location, String> locationCode
147150
return null;
148151
}
149152

150-
protected String getPatientIdentifier(Integer personId) {
153+
protected String getPatientIdentifier(Integer personId, String locationCode) {
151154
PatientService patientService = Context.getPatientService();
152155
Patient patient = patientService.getPatient(personId);
153156
PatientIdentifierType pit = patientService.getPatientIdentifierTypeByUuid(ISANTEPLUS_IDENDTIFIER_TYPE_UUID);
154157
patient.getPatientIdentifier(pit);
155158
PatientIdentifier pid = patient.getPatientIdentifier(pit);
156-
return pid != null ? pid.getIdentifier() : "";
159+
return pid != null ? pid.getIdentifier() : locationCode + '4' + personId;
157160
}
158161
}

0 commit comments

Comments
 (0)