[507] | 1 | /*
|
---|
| 2 | * To change this template, choose Tools | Templates
|
---|
| 3 | * and open the template in the editor.
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | package gov.hhs.fha.nhinc.adaptermpimanager;
|
---|
| 7 |
|
---|
| 8 | import org.apache.commons.logging.Log;
|
---|
| 9 | import org.apache.commons.logging.LogFactory;
|
---|
| 10 | import org.hl7.v3.*;
|
---|
| 11 | import gov.hhs.fha.nhinc.mpilib.*;
|
---|
| 12 | import gov.hhs.fha.nhinc.adaptermpimanager.HL7Parsers.*;
|
---|
| 13 |
|
---|
| 14 | /**
|
---|
| 15 | *
|
---|
| 16 | * @author mflynn02
|
---|
| 17 | */
|
---|
| 18 | public class MpiDataAccess {
|
---|
| 19 | private static Log log = LogFactory.getLog(MpiDataAccess.class);
|
---|
| 20 | public static Patients LookupPatients(PRPAMT201301UVPatient patient) {
|
---|
| 21 | return LookupPatients(patient, true);
|
---|
| 22 | }
|
---|
| 23 |
|
---|
| 24 | public static Patients LookupPatients(PRPAMT201301UVPatient patient, boolean AllowSearchByDemographics) {
|
---|
| 25 | return LookupPatients(HL7Parser201301.ExtractMpiPatientFromHL7Patient(patient), AllowSearchByDemographics);
|
---|
| 26 | }
|
---|
| 27 |
|
---|
| 28 | public static Patients LookupPatients(Patient searchParams) {
|
---|
| 29 | return LookupPatients(searchParams,true);
|
---|
| 30 | }
|
---|
| 31 | public static Patients LookupPatients(Patient searchParams, boolean AllowSearchByDemographics) {
|
---|
| 32 | MiniMpi mpi = MiniMpi.GetMpiInstance();
|
---|
| 33 | return mpi.Search(searchParams,AllowSearchByDemographics);
|
---|
| 34 | }
|
---|
| 35 | public static Patients LookupPatients(Patient searchParams, boolean AllowSearchByDemographics, boolean includeOptOutPatient) {
|
---|
| 36 | MiniMpi mpi = MiniMpi.GetMpiInstance();
|
---|
| 37 | return mpi.Search(searchParams,AllowSearchByDemographics,includeOptOutPatient);
|
---|
| 38 | }
|
---|
| 39 | public static Patient SavePatient(Patient patient) {
|
---|
| 40 | MiniMpi mpi = MiniMpi.GetMpiInstance();
|
---|
| 41 | return mpi.AddUpdate(patient);
|
---|
| 42 | }
|
---|
| 43 |
|
---|
| 44 | public static void DeletePatient(Patient patient, String homeCommunityId) {
|
---|
| 45 | MiniMpi mpi = MiniMpi.GetMpiInstance();
|
---|
| 46 | mpi.Delete(patient, homeCommunityId);
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | }
|
---|