Skip to content

Commit

Permalink
Merge pull request #24 from pmanko/stansL
Browse files Browse the repository at this point in the history
Updates to MPI workflows for FHIR-based OpenCR by @stansL
  • Loading branch information
pmanko authored Dec 17, 2020
2 parents 39d41d7 + 8ceffe5 commit 8250d71
Show file tree
Hide file tree
Showing 22 changed files with 801 additions and 120 deletions.
22 changes: 22 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,22 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>santedb-mpiclient-api</artifactId>
<version>${mpiClientVersion}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>xds-sender-api</artifactId>
</dependency>
<dependency>
<groupId>org.openmrs.module</groupId>
<artifactId>santedb-mpiclient-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
Expand All @@ -138,6 +150,16 @@
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ public final class RegistrationCoreConstants {

public static final String GP_OPENMRS_IDENTIFIER_UUID = "registrationcore.openmrsIdenitfier.uuid";

public static final String GP_CODE_PC_IDENTIFIER_UUID = "registrationcore.codePc.uuid";

public static final String GP_CODE_ST_IDENTIFIER_UUID = "registrationcore.codeSt.uuid";

public static final String DATE_FORMAT_STRING = "yyyy-MM-dd HH:mm:ss";

public static final String PATIENT_REGISTRATION_EVENT_TOPIC_NAME = "org.openmrs.module.registrationcore.PatientRegistrationEvent";
Expand Down Expand Up @@ -72,6 +76,8 @@ public final class RegistrationCoreConstants {

public static final String GP_MPI_PIX_ENDPOINT= "registrationcore.mpi.pixEndpoint";

public static final String GP_MPI_FHIR_ENDPOINT= "registrationcore.mpi.fhirEndpoint";

public static final String GP_MPI_PIX_PORT = "registrationcore.mpi.pixPort";

public static final String GP_MPI_SENDING_APPLICATION = "registrationcore.mpi.sendingApplication";
Expand All @@ -98,10 +104,12 @@ public final class RegistrationCoreConstants {
public static final String GP_MPI_PIX_ERROR_HANDLER_IMPLEMENTATION = "registrationcore.mpi.pix.errorHandler.implementation";

public static final String GP_MPI_PDQ_ERROR_HANDLER_IMPLEMENTATION = "registrationcore.mpi.pdq.errorHandler.implementation";

public static final String MPI_IDENTIFIER_TYPE_ECID_NAME = "ECID";

public static final String LOCAL_FINGERPRINT_NAME = "localFingerprint";

public static final String NATIONAL_FINGERPRINT_NAME = "nationalFingerprint";

public static final String GP_MPI_REG_ENCOUNTER_UUID = "registrationcore.mpi.reg.encounter.uuid";
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.openmrs.module.registrationcore.api.biometrics.model.BiometricData;
import org.openmrs.module.registrationcore.api.biometrics.model.BiometricSubject;
import org.openmrs.module.registrationcore.api.search.PatientAndMatchQuality;
import org.openmrs.module.santedb.mpiclient.model.MpiPatient;
import org.openmrs.module.xdssender.api.domain.Ccd;

//import org.openmrs.module.m2sysbiometrics.service.RegistrationService;
Expand Down Expand Up @@ -154,6 +155,14 @@ List<PatientAndMatchQuality> findPreciseSimilarPatients(Patient patient, Map<Str
* @return found patient
*/
Patient findMpiPatient(String identifier, String identifierTypeUuid);
/**
* Query to MPI server to find patient with Id "patientId".
*
* @param identifier person identifier of patient which should be imported
* @param identifierTypeUuid person identifier type of patient which will be found
* @return found patient with attached observations
*/
MpiPatient fetchMpiPatientWithObservations(String identifier, String identifierTypeUuid);

/**
* Query to MPI server to find patient with Id "patientId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openmrs.EncounterRole;
import org.openmrs.api.APIException;
import org.openmrs.api.context.Context;
import org.openmrs.module.registrationcore.RegistrationCoreConstants;
Expand Down Expand Up @@ -169,4 +170,13 @@ private <T> T getComponentByPropertyName(String propertyName, Class<T> type) {
log.debug("Looking up component: " + handlerId);
return Context.getRegisteredComponent(handlerId, type);
}

public String getRegistrationEncounterTypeUuid() {
return Context.getAdministrationService().getGlobalProperty(
RegistrationCoreConstants.GP_MPI_REG_ENCOUNTER_UUID, "873f968a-73a8-4f9c-ac78-9f4778b751b6");
}

public EncounterRole getRegistrationEncounterRole() {
return Context.getEncounterService().getEncounterRoleByUuid("240b26f9-dd88-4172-823d-4a8bfeb7841f");
}
}
Loading

0 comments on commit 8250d71

Please sign in to comment.