[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.transform.subdisc;
|
---|
| 7 |
|
---|
| 8 | import javax.xml.bind.JAXBElement;
|
---|
| 9 | import org.hl7.v3.*;
|
---|
| 10 |
|
---|
| 11 | /**
|
---|
| 12 | *
|
---|
| 13 | * @author MFLYNN02
|
---|
| 14 | */
|
---|
| 15 | public class HL7PRPA201303Transforms {
|
---|
| 16 | public static PRPAIN201303UV createPRPA201303 (PRPAMT201305UVPatient patient, String senderOID, String receiverOID, String localDeviceId) {
|
---|
| 17 | PRPAIN201303UV result = new PRPAIN201303UV();
|
---|
| 18 |
|
---|
| 19 | // Create the 201305 message header fields
|
---|
| 20 | result.setITSVersion(HL7Constants.ITS_VERSION);
|
---|
| 21 | result.setId(HL7MessageIdGenerator.GenerateHL7MessageId(localDeviceId));
|
---|
| 22 | result.setCreationTime(HL7DataTransformHelper.CreationTimeFactory());
|
---|
| 23 | result.setInteractionId(HL7DataTransformHelper.IIFactory(HL7Constants.INTERACTION_ID_ROOT, "PRPA_IN201305UV"));
|
---|
| 24 | result.setProcessingCode(HL7DataTransformHelper.CSFactory("P"));
|
---|
| 25 | result.setProcessingModeCode(HL7DataTransformHelper.CSFactory("R"));
|
---|
| 26 | result.setAcceptAckCode(HL7DataTransformHelper.CSFactory("AL"));
|
---|
| 27 |
|
---|
| 28 | // Create the Sender
|
---|
| 29 | result.setSender(HL7SenderTransforms.createMCCIMT000100UV01Sender(senderOID));
|
---|
| 30 |
|
---|
| 31 | // Create the Receiver
|
---|
| 32 | result.getReceiver().add(HL7ReceiverTransforms.createMCCIMT000100UV01Receiver(receiverOID));
|
---|
| 33 |
|
---|
| 34 | result.setControlActProcess(createControlActProcess(patient, localDeviceId));
|
---|
| 35 | return result;
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | public static PRPAIN201303UVMFMIMT700701UV01ControlActProcess createControlActProcess (PRPAMT201305UVPatient patient, String localDeviceId) {
|
---|
| 39 | PRPAIN201303UVMFMIMT700701UV01ControlActProcess controlActProcess = new PRPAIN201303UVMFMIMT700701UV01ControlActProcess();
|
---|
| 40 | PRPAIN201303UVMFMIMT700701UV01RegistrationEvent regevent = new PRPAIN201303UVMFMIMT700701UV01RegistrationEvent();
|
---|
| 41 | PRPAIN201303UVMFMIMT700701UV01Subject1 subject1 = new PRPAIN201303UVMFMIMT700701UV01Subject1();
|
---|
| 42 |
|
---|
| 43 | controlActProcess.setMoodCode("EVN");
|
---|
| 44 |
|
---|
| 45 | controlActProcess.setCode(HL7DataTransformHelper.CDFactory("PRPA_TE201303UV", HL7Constants.INTERACTION_ID_ROOT));
|
---|
| 46 |
|
---|
| 47 | /**
|
---|
| 48 | * TODO: This needs to be broken out into separate methods.
|
---|
| 49 | */
|
---|
| 50 | PRPAIN201303UVMFMIMT700701UV01Subject2 subject = new PRPAIN201303UVMFMIMT700701UV01Subject2();
|
---|
| 51 | subject.setPatient(patient);
|
---|
| 52 | regevent.setSubject1(subject);
|
---|
| 53 | subject1.setRegistrationEvent(regevent);
|
---|
| 54 | controlActProcess.getSubject().add(subject1);
|
---|
| 55 |
|
---|
| 56 | return controlActProcess;
|
---|
| 57 | }
|
---|
| 58 |
|
---|
| 59 | }
|
---|