diff --git a/api/src/main/java/org/openmrs/module/xdssender/XdsSenderConfig.java b/api/src/main/java/org/openmrs/module/xdssender/XdsSenderConfig.java index 7c9f68b..66e61a1 100644 --- a/api/src/main/java/org/openmrs/module/xdssender/XdsSenderConfig.java +++ b/api/src/main/java/org/openmrs/module/xdssender/XdsSenderConfig.java @@ -40,8 +40,10 @@ public class XdsSenderConfig { private static final String ENCOUNTER_ROOT = "xdssender.encounterRoot"; private static final String OBS_ROOT = "xdssender.obsRoot"; - + private static final String ECID_ROOT = "xdssender.ecidRoot"; + + private static final String CR_ROOT = "xdssender.crRoot"; private static final String CODE_NATIONAL_ROOT = "xdssender.codeNationalRoot"; @@ -247,5 +249,8 @@ private T getComponentByGlobalProperty(String propertyName, Class type) { return Context.getRegisteredComponent(getProperty(propertyName), type); } + public String getCrRoot() { + return getProperty(CR_ROOT, "http://openclientregistry.org/fhir/sourceid"); + } } diff --git a/api/src/main/java/org/openmrs/module/xdssender/api/fhir/FhirResourceDocumentBuilderImpl.java b/api/src/main/java/org/openmrs/module/xdssender/api/fhir/FhirResourceDocumentBuilderImpl.java index e9895ac..dece63d 100644 --- a/api/src/main/java/org/openmrs/module/xdssender/api/fhir/FhirResourceDocumentBuilderImpl.java +++ b/api/src/main/java/org/openmrs/module/xdssender/api/fhir/FhirResourceDocumentBuilderImpl.java @@ -118,8 +118,8 @@ private org.hl7.fhir.r4.model.Patient checkAndSetSystemIdentifier(Patient patien throw new ResourceGenerationException("Unable to retrieve the Local PID, ensure that the \"PID LOCAL\" global property has been set"); } - patientResource.addIdentifier().setSystem(XdsSenderConfig.getInstance().getEcidRoot()).setValue(systemPatientIdentifier.getIdentifier()); - // qpatientResource.addIdentifier().setSystem(XdsSenderConstants.IDENTIFIER_SYSTEM).setValue(systemPatientIdentifier.getIdentifier()); + patientResource.addIdentifier().setSystem(XdsSenderConfig.getInstance().getCrRoot()).setValue(systemPatientIdentifier.getIdentifier()); + // patientResource.addIdentifier().setSystem(XdsSenderConstants.IDENTIFIER_SYSTEM).setValue(systemPatientIdentifier.getIdentifier()); } return patientResource; diff --git a/api/src/test/resources/global-configs.xml b/api/src/test/resources/global-configs.xml index bbc844b..27ed7e9 100644 --- a/api/src/test/resources/global-configs.xml +++ b/api/src/test/resources/global-configs.xml @@ -10,10 +10,14 @@ description="PID Local" uuid="EF15944A-D73C-4D9C-9D86-E06FC076CA70"/> - + + xdssender.ecidRoot ECID Root + 2.16.840.1.113883.4.56 + + + + xdssender.crRoot + CR Root http://openclientregistry.org/fhir/sourceid diff --git a/pom.xml b/pom.xml index 66b2935..df51025 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ - 2.3.0 + 2.4.0-SNAPSHOT 2.0.5 1.1.0 2.0.6