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.transform.subdisc;
|
---|
7 |
|
---|
8 | import org.hl7.v3.II;
|
---|
9 | import org.hl7.v3.PRPAIN201301UV;
|
---|
10 | import org.hl7.v3.PRPAIN201301UVMFMIMT700701UV01ControlActProcess;
|
---|
11 | import org.hl7.v3.PRPAIN201301UVMFMIMT700701UV01RegistrationEvent;
|
---|
12 | import org.hl7.v3.PRPAIN201301UVMFMIMT700701UV01Subject1;
|
---|
13 | import org.hl7.v3.PRPAIN201301UVMFMIMT700701UV01Subject2;
|
---|
14 | import org.hl7.v3.PRPAMT201301UVPatient;
|
---|
15 |
|
---|
16 | /**
|
---|
17 | *
|
---|
18 | * @author Jon Hoppesch
|
---|
19 | */
|
---|
20 | public class HL7PRPA201301Transforms {
|
---|
21 | public static PRPAIN201301UV createPRPA201301 (PRPAMT201301UVPatient patient, String localDeviceId, String senderOID, String receiverOID) {
|
---|
22 | PRPAIN201301UV result = new PRPAIN201301UV();
|
---|
23 |
|
---|
24 | // Create the 201301 message header fields
|
---|
25 | result.setITSVersion(HL7Constants.ITS_VERSION);
|
---|
26 | result.setId(HL7MessageIdGenerator.GenerateHL7MessageId(localDeviceId));
|
---|
27 | result.setCreationTime(HL7DataTransformHelper.CreationTimeFactory());
|
---|
28 | result.setInteractionId(HL7DataTransformHelper.IIFactory(HL7Constants.INTERACTION_ID_ROOT, "PRPA_IN201301UV"));
|
---|
29 | result.setProcessingCode(HL7DataTransformHelper.CSFactory("T"));
|
---|
30 | result.setProcessingModeCode(HL7DataTransformHelper.CSFactory("T"));
|
---|
31 | result.setAcceptAckCode(HL7DataTransformHelper.CSFactory("AL"));
|
---|
32 |
|
---|
33 | // Create the Sender
|
---|
34 | result.setSender(HL7SenderTransforms.createMCCIMT000100UV01Sender(senderOID));
|
---|
35 |
|
---|
36 | // Create the Receiver
|
---|
37 | result.getReceiver().add(HL7ReceiverTransforms.createMCCIMT000100UV01Receiver(receiverOID));
|
---|
38 |
|
---|
39 | // Create the control act process
|
---|
40 | result.setControlActProcess(createMFMIMT700701UV01ControlActProcess(patient, localDeviceId));
|
---|
41 |
|
---|
42 | return result;
|
---|
43 | }
|
---|
44 |
|
---|
45 | public static PRPAIN201301UVMFMIMT700701UV01ControlActProcess createMFMIMT700701UV01ControlActProcess (PRPAMT201301UVPatient patient, String localDeviceId) {
|
---|
46 | PRPAIN201301UVMFMIMT700701UV01ControlActProcess controlActProcess = new PRPAIN201301UVMFMIMT700701UV01ControlActProcess();
|
---|
47 |
|
---|
48 | controlActProcess.setMoodCode("EVN");
|
---|
49 |
|
---|
50 | controlActProcess.setCode(HL7DataTransformHelper.CDFactory("PRPA_TE201301UV"));
|
---|
51 |
|
---|
52 | controlActProcess.getSubject().add(createPRPAIN201301UVMFMIMT700701UV01Subject1(patient, localDeviceId));
|
---|
53 | return controlActProcess;
|
---|
54 | }
|
---|
55 |
|
---|
56 | public static PRPAIN201301UVMFMIMT700701UV01Subject1 createPRPAIN201301UVMFMIMT700701UV01Subject1(PRPAMT201301UVPatient patient, String localDeviceId) {
|
---|
57 | PRPAIN201301UVMFMIMT700701UV01Subject1 subject1 = new PRPAIN201301UVMFMIMT700701UV01Subject1();
|
---|
58 |
|
---|
59 | subject1.getTypeCode().add("SUBJ");
|
---|
60 | subject1.setContextConductionInd(false);
|
---|
61 |
|
---|
62 | subject1.setRegistrationEvent(createPRPAIN201301UVMFMIMT700701UV01RegistrationEvent(patient, localDeviceId));
|
---|
63 |
|
---|
64 | return subject1;
|
---|
65 | }
|
---|
66 |
|
---|
67 | public static PRPAIN201301UVMFMIMT700701UV01RegistrationEvent createPRPAIN201301UVMFMIMT700701UV01RegistrationEvent (PRPAMT201301UVPatient patient, String localDeviceId) {
|
---|
68 | PRPAIN201301UVMFMIMT700701UV01RegistrationEvent regevent = new PRPAIN201301UVMFMIMT700701UV01RegistrationEvent();
|
---|
69 |
|
---|
70 | regevent.getClassCode().add("REG");
|
---|
71 | regevent.getMoodCode().add("EVN");
|
---|
72 |
|
---|
73 | II regId = new II();
|
---|
74 | regId.getNullFlavor().add("NA");
|
---|
75 | regevent.getId().add(regId);
|
---|
76 |
|
---|
77 | regevent.setStatusCode(HL7DataTransformHelper.CSFactory("active"));
|
---|
78 |
|
---|
79 | regevent.setSubject1(createPRPAIN201301UVMFMIMT700701UV01Subject2(patient));
|
---|
80 |
|
---|
81 | regevent.setCustodian(HL7CustodianTransforms.createMFMIMT700701UV01Custodian(localDeviceId));
|
---|
82 |
|
---|
83 | return regevent;
|
---|
84 | }
|
---|
85 |
|
---|
86 | public static PRPAIN201301UVMFMIMT700701UV01Subject2 createPRPAIN201301UVMFMIMT700701UV01Subject2 (PRPAMT201301UVPatient patient) {
|
---|
87 | PRPAIN201301UVMFMIMT700701UV01Subject2 subject = new PRPAIN201301UVMFMIMT700701UV01Subject2();
|
---|
88 |
|
---|
89 | subject.setPatient(patient);
|
---|
90 |
|
---|
91 | return subject;
|
---|
92 | }
|
---|
93 |
|
---|
94 | }
|
---|