org.openhealthexchange.openpixpdq.ihe
Interface IPixManagerAdapter


public interface IPixManagerAdapter

This PIXManager Adapter is the bridge between IHE PIX Manager actor and underneath eMPI. OpenPIXPDQ, according to the IHE PIX specifications, invokes the methods in this Adapter, whose implementation is provided by the underneath eMPI.

Version:
1.0, Oct 21, 2008
Author:
Wenzhi Li

Method Summary
 java.util.List<PatientIdentifier> createPatient(Patient patient, MessageHeader header)
          Creates a new patient in the eMPI database.
 java.util.List<PatientIdentifier> findPatientIds(PatientIdentifier pid, MessageHeader header)
          Finds from the underneath eMPI all patient ids cross all patient domains (assigning authorities) given a patient id in a particular domain.
 boolean isValidPatient(PatientIdentifier pid, MessageHeader header)
          Whether the given patient is a valid patient in the eMPI database.
 java.util.List<java.util.List<PatientIdentifier>> mergePatients(Patient patientMain, Patient patientOld, MessageHeader header)
          Merges two patients together because they have been found to be the same patient.
 java.util.List<java.util.List<PatientIdentifier>> updatePatient(Patient patient, MessageHeader header)
          Updates the patient's demographics in the eMPI's database.
 

Method Detail

isValidPatient

boolean isValidPatient(PatientIdentifier pid,
                       MessageHeader header)
                       throws PixManagerException
Whether the given patient is a valid patient in the eMPI database.

Parameters:
pid - the PatientIdentifier to be checked
header - the MessageHeader from the incoming PIX client message
Returns:
true if the patient id is valid; false otherwise.
Throws:
PixManagerException

findPatientIds

java.util.List<PatientIdentifier> findPatientIds(PatientIdentifier pid,
                                                 MessageHeader header)
                                                 throws PixManagerException
Finds from the underneath eMPI all patient ids cross all patient domains (assigning authorities) given a patient id in a particular domain. All retrieved patient ids must represent the same logic patient, though they may exist in different patient id domains.

Parameters:
header - the MessageHeader of the incoming PIX Query message
Returns:
A list of PatientIdentifier which does not include the request patient id. Return an empty list instead of null if no matching is found.
Throws:
PixManagerException - when there is trouble cross finding all patients

createPatient

java.util.List<PatientIdentifier> createPatient(Patient patient,
                                                MessageHeader header)
                                                throws PixManagerException
Creates a new patient in the eMPI database. This method sends the patient demographics contained in the Patient to the underneath eMPI.

Parameters:
patient - the demographics of the patient to be created
header - the MessageHeader of the incoming PIX Feed message
Returns:
a list of new matching PatientIdentifiers of this patient as a result of creating this patient. OpenPIXPDQ will send a PIX Update Notification message for this list to those PIX Consumers that have subscribed to PIX Update Notification.

If PIX Update Notification is not supported, or if there is no matching (i.e, the patient is registered for the first time, no need to send PIX Update Notification Message), an empty list or null can be returned.

Throws:
PixManagerException - When there is trouble creating the patient

updatePatient

java.util.List<java.util.List<PatientIdentifier>> updatePatient(Patient patient,
                                                                MessageHeader header)
                                                                throws PixManagerException
Updates the patient's demographics in the eMPI's database. This method sends the updated patient demographics contained in the Patient to the underneath eMPI.

Parameters:
patient - the new demographics of the patient to be updated
header - the MessageHeader of the incoming PIX Update message
Returns:
a list of list of updated matching PatientIdentifiers as a result of updating this patient. The outer list is used to store different logic patients, while each inner list represents the same logic patient with matching patient ids across patient id domains. For each inner list (matching list), OpenPIXPDQ will send a PIX Update Notification message to those PIX Consumers that have subscribed to PIX Update Notification.

For example, if patient(A)'s address is updated, and this results in an un-matching of originally matched patients (A, B, C & D), two lists are created, one list representing updated matching patients (A, E & F); the other one representing updated un-matching patients (B, C & D).

If PIX Update Notification is not supported, or if there is no update on the patient matching list, just return an empty list or null.

Throws:
PixManagerException - when there is trouble updating the patient

mergePatients

java.util.List<java.util.List<PatientIdentifier>> mergePatients(Patient patientMain,
                                                                Patient patientOld,
                                                                MessageHeader header)
                                                                throws PixManagerException
Merges two patients together because they have been found to be the same patient. The first argument describes the surviving patient demographics; the second argument represents the patient to be merged with the surviving patient. This method sends the surviving and merged patients to the underneath eMPI.

Parameters:
patientMain - the surviving patient
patientOld - the patient to be replaced, and merged with the surviving patient
header - the MessageHeader of the incoming PIX Merge message
Returns:
a list of list of updated matching PatientIdentifiers as a result of merging patients. The outer list is used to store different logic patients, while each inner list represents the same logic patient with matching patient ids across patient id domains. For each inner list (matching list), OpenPIXPDQ will send a PIX Update Notification message to those PIX Consumers that have subscribed to PIX Update Notification.

If PIX Update Notification is not supported, or if there is no update on the patient matching list, just return an empty list or null.

Throws:
PixManagerException - when there is trouble merging the patients