[507] | 1 | /*
|
---|
| 2 | * To change this template, choose Tools | Templates
|
---|
| 3 | * and open the template in the editor.
|
---|
| 4 | */
|
---|
| 5 | package gov.hhs.fha.nhinc.transform.subdisc;
|
---|
| 6 |
|
---|
| 7 | import org.hl7.v3.II;
|
---|
| 8 | import org.hl7.v3.PRPAIN201302UV;
|
---|
| 9 | import org.hl7.v3.PRPAIN201302UVMFMIMT700701UV01ControlActProcess;
|
---|
| 10 | import org.hl7.v3.PRPAIN201302UVMFMIMT700701UV01RegistrationEvent;
|
---|
| 11 | import org.hl7.v3.PRPAIN201302UVMFMIMT700701UV01Subject1;
|
---|
| 12 | import org.hl7.v3.PRPAIN201302UVMFMIMT700701UV01Subject2;
|
---|
| 13 | import org.hl7.v3.PRPAMT201301UVPatient;
|
---|
| 14 | import org.hl7.v3.PRPAMT201310UVPatient;
|
---|
| 15 |
|
---|
| 16 | /**
|
---|
| 17 | *
|
---|
| 18 | * @author Jon Hoppesch
|
---|
| 19 | */
|
---|
| 20 | public class HL7PRPA201302Transforms {
|
---|
| 21 | private static PRPAIN201302UV result = null;
|
---|
| 22 | private static String localDeviceId = new String();
|
---|
| 23 |
|
---|
| 24 | public static PRPAIN201302UV createPRPA201302(PRPAMT201301UVPatient patient, String remotePatId, String remoteDeviceId, String senderOID, String receiverOID) {
|
---|
| 25 | result = new PRPAIN201302UV();
|
---|
| 26 | localDeviceId = patient.getId().get(0).getRoot();
|
---|
| 27 | setHeaderFields(senderOID, receiverOID);
|
---|
| 28 |
|
---|
| 29 | // Create the control act process
|
---|
| 30 | result.setControlActProcess(createMFMIMT700701UV01ControlActProcess(patient, remotePatId, remoteDeviceId));
|
---|
| 31 |
|
---|
| 32 | return result;
|
---|
| 33 | }
|
---|
| 34 |
|
---|
| 35 | public static PRPAIN201302UV createPRPA201302(PRPAMT201310UVPatient patient, String remotePatId, String remoteDeviceId, String senderOID, String receiverOID) {
|
---|
| 36 | result = new PRPAIN201302UV();
|
---|
| 37 | localDeviceId = patient.getId().get(0).getRoot();
|
---|
| 38 | setHeaderFields(senderOID, receiverOID);
|
---|
| 39 |
|
---|
| 40 | // Create the control act process
|
---|
| 41 | result.setControlActProcess(createMFMIMT700701UV01ControlActProcess(patient, remotePatId, remoteDeviceId));
|
---|
| 42 |
|
---|
| 43 | return result;
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | private static void setHeaderFields (String senderOID, String receiverOID) {
|
---|
| 47 | // Create the 201302 message header fields
|
---|
| 48 | result.setITSVersion(HL7Constants.ITS_VERSION);
|
---|
| 49 | result.setId(HL7MessageIdGenerator.GenerateHL7MessageId(localDeviceId));
|
---|
| 50 | result.setCreationTime(HL7DataTransformHelper.CreationTimeFactory());
|
---|
| 51 | result.setInteractionId(HL7DataTransformHelper.IIFactory(HL7Constants.INTERACTION_ID_ROOT, "PRPA_IN201302UV"));
|
---|
| 52 | result.setProcessingCode(HL7DataTransformHelper.CSFactory("T"));
|
---|
| 53 | result.setProcessingModeCode(HL7DataTransformHelper.CSFactory("T"));
|
---|
| 54 | result.setAcceptAckCode(HL7DataTransformHelper.CSFactory("AL"));
|
---|
| 55 |
|
---|
| 56 | // Create the Sender
|
---|
| 57 | result.setSender(HL7SenderTransforms.createMCCIMT000100UV01Sender(senderOID));
|
---|
| 58 |
|
---|
| 59 | // Create the Receiver
|
---|
| 60 | result.getReceiver().add(HL7ReceiverTransforms.createMCCIMT000100UV01Receiver(receiverOID));
|
---|
| 61 | }
|
---|
| 62 |
|
---|
| 63 | public static PRPAIN201302UVMFMIMT700701UV01ControlActProcess createMFMIMT700701UV01ControlActProcess(PRPAMT201301UVPatient patient, String remotePatId, String remoteDeviceId) {
|
---|
| 64 | PRPAIN201302UVMFMIMT700701UV01ControlActProcess controlActProcess = new PRPAIN201302UVMFMIMT700701UV01ControlActProcess();
|
---|
| 65 |
|
---|
| 66 | controlActProcess.setMoodCode("EVN");
|
---|
| 67 |
|
---|
| 68 | controlActProcess.setCode(HL7DataTransformHelper.CDFactory("PRPA_TE201302UV"));
|
---|
| 69 |
|
---|
| 70 | controlActProcess.getSubject().add(createPRPAIN201302UVMFMIMT700701UV01Subject1(patient, remotePatId, remoteDeviceId));
|
---|
| 71 | return controlActProcess;
|
---|
| 72 | }
|
---|
| 73 |
|
---|
| 74 | public static PRPAIN201302UVMFMIMT700701UV01ControlActProcess createMFMIMT700701UV01ControlActProcess(PRPAMT201310UVPatient patient, String remotePatId, String remoteDeviceId) {
|
---|
| 75 | PRPAIN201302UVMFMIMT700701UV01ControlActProcess controlActProcess = new PRPAIN201302UVMFMIMT700701UV01ControlActProcess();
|
---|
| 76 |
|
---|
| 77 | controlActProcess.setMoodCode("EVN");
|
---|
| 78 |
|
---|
| 79 | controlActProcess.setCode(HL7DataTransformHelper.CDFactory("PRPA_TE201302UV"));
|
---|
| 80 |
|
---|
| 81 | controlActProcess.getSubject().add(createPRPAIN201302UVMFMIMT700701UV01Subject1(patient, remotePatId, remoteDeviceId));
|
---|
| 82 | return controlActProcess;
|
---|
| 83 | }
|
---|
| 84 |
|
---|
| 85 | public static PRPAIN201302UVMFMIMT700701UV01Subject1 createPRPAIN201302UVMFMIMT700701UV01Subject1(PRPAMT201301UVPatient patient, String remotePatId, String remoteDeviceId) {
|
---|
| 86 | PRPAIN201302UVMFMIMT700701UV01Subject1 subject1 = new PRPAIN201302UVMFMIMT700701UV01Subject1();
|
---|
| 87 |
|
---|
| 88 | subject1.getTypeCode().add("SUBJ");
|
---|
| 89 | subject1.setContextConductionInd(false);
|
---|
| 90 |
|
---|
| 91 | subject1.setRegistrationEvent(createPRPAIN201302UVMFMIMT700701UV01RegistrationEvent(patient, remotePatId, remoteDeviceId));
|
---|
| 92 |
|
---|
| 93 | return subject1;
|
---|
| 94 | }
|
---|
| 95 |
|
---|
| 96 | public static PRPAIN201302UVMFMIMT700701UV01Subject1 createPRPAIN201302UVMFMIMT700701UV01Subject1(PRPAMT201310UVPatient patient, String remotePatId, String remoteDeviceId) {
|
---|
| 97 | PRPAIN201302UVMFMIMT700701UV01Subject1 subject1 = new PRPAIN201302UVMFMIMT700701UV01Subject1();
|
---|
| 98 |
|
---|
| 99 | subject1.getTypeCode().add("SUBJ");
|
---|
| 100 | subject1.setContextConductionInd(false);
|
---|
| 101 |
|
---|
| 102 | subject1.setRegistrationEvent(createPRPAIN201302UVMFMIMT700701UV01RegistrationEvent(patient, remotePatId, remoteDeviceId));
|
---|
| 103 |
|
---|
| 104 | return subject1;
|
---|
| 105 | }
|
---|
| 106 |
|
---|
| 107 | public static PRPAIN201302UVMFMIMT700701UV01RegistrationEvent createPRPAIN201302UVMFMIMT700701UV01RegistrationEvent(PRPAMT201301UVPatient patient, String remotePatId, String remoteDeviceId) {
|
---|
| 108 | PRPAIN201302UVMFMIMT700701UV01RegistrationEvent regevent = new PRPAIN201302UVMFMIMT700701UV01RegistrationEvent();
|
---|
| 109 |
|
---|
| 110 | regevent.getClassCode().add("REG");
|
---|
| 111 | regevent.getMoodCode().add("EVN");
|
---|
| 112 |
|
---|
| 113 | II regId = new II();
|
---|
| 114 | regId.getNullFlavor().add("NA");
|
---|
| 115 | regevent.getId().add(regId);
|
---|
| 116 |
|
---|
| 117 | regevent.setStatusCode(HL7DataTransformHelper.CSFactory("active"));
|
---|
| 118 |
|
---|
| 119 | regevent.setSubject1(createPRPAIN201302UVMFMIMT700701UV01Subject2(patient, remotePatId, remoteDeviceId));
|
---|
| 120 |
|
---|
| 121 | regevent.setCustodian(HL7CustodianTransforms.createMFMIMT700701UV01Custodian(localDeviceId));
|
---|
| 122 |
|
---|
| 123 | return regevent;
|
---|
| 124 | }
|
---|
| 125 |
|
---|
| 126 | public static PRPAIN201302UVMFMIMT700701UV01RegistrationEvent createPRPAIN201302UVMFMIMT700701UV01RegistrationEvent(PRPAMT201310UVPatient patient, String remotePatId, String remoteDeviceId) {
|
---|
| 127 | PRPAIN201302UVMFMIMT700701UV01RegistrationEvent regevent = new PRPAIN201302UVMFMIMT700701UV01RegistrationEvent();
|
---|
| 128 |
|
---|
| 129 | regevent.getClassCode().add("REG");
|
---|
| 130 | regevent.getMoodCode().add("EVN");
|
---|
| 131 |
|
---|
| 132 | II regId = new II();
|
---|
| 133 | regId.getNullFlavor().add("NA");
|
---|
| 134 | regevent.getId().add(regId);
|
---|
| 135 |
|
---|
| 136 | regevent.setStatusCode(HL7DataTransformHelper.CSFactory("active"));
|
---|
| 137 |
|
---|
| 138 | regevent.setSubject1(createPRPAIN201302UVMFMIMT700701UV01Subject2(patient, remotePatId, remoteDeviceId));
|
---|
| 139 |
|
---|
| 140 | regevent.setCustodian(HL7CustodianTransforms.createMFMIMT700701UV01Custodian(localDeviceId));
|
---|
| 141 |
|
---|
| 142 | return regevent;
|
---|
| 143 | }
|
---|
| 144 |
|
---|
| 145 | public static PRPAIN201302UVMFMIMT700701UV01Subject2 createPRPAIN201302UVMFMIMT700701UV01Subject2(PRPAMT201301UVPatient patient, String remotePatId, String remoteDeviceId) {
|
---|
| 146 | PRPAIN201302UVMFMIMT700701UV01Subject2 subject = new PRPAIN201302UVMFMIMT700701UV01Subject2();
|
---|
| 147 |
|
---|
| 148 | subject.setPatient(HL7PatientTransforms.create201302Patient(remotePatId, remoteDeviceId, patient.getPatientPerson(), patient.getId().get(0)));
|
---|
| 149 |
|
---|
| 150 | return subject;
|
---|
| 151 | }
|
---|
| 152 |
|
---|
| 153 | public static PRPAIN201302UVMFMIMT700701UV01Subject2 createPRPAIN201302UVMFMIMT700701UV01Subject2(PRPAMT201310UVPatient patient, String remotePatId, String remoteDeviceId) {
|
---|
| 154 | PRPAIN201302UVMFMIMT700701UV01Subject2 subject = new PRPAIN201302UVMFMIMT700701UV01Subject2();
|
---|
| 155 |
|
---|
| 156 | subject.setPatient(HL7PatientTransforms.create201302Patient(patient.getPatientPerson(), remotePatId, remoteDeviceId, patient.getId().get(0)));
|
---|
| 157 |
|
---|
| 158 | return subject;
|
---|
| 159 | }
|
---|
| 160 | }
|
---|