Search in sources :

Example 6 with Segment

use of ca.uhn.hl7v2.model.Segment in project camel by apache.

the class HL7MLLPCodecTest method createHL7AsMessage.

// START SNIPPET: e3
private static Message createHL7AsMessage() throws Exception {
    ADR_A19 adr = new ADR_A19();
    adr.initQuickstart("ADR", "A19", "P");
    // Populate the MSH Segment
    MSH mshSegment = adr.getMSH();
    mshSegment.getDateTimeOfMessage().getTimeOfAnEvent().setValue("200701011539");
    mshSegment.getSendingApplication().getNamespaceID().setValue("MYSENDER");
    mshSegment.getMessageControlID().setValue("456");
    // Populate the PID Segment
    MSA msa = adr.getMSA();
    msa.getAcknowledgementCode().setValue("AA");
    msa.getMessageControlID().setValue("123");
    QRD qrd = adr.getQRD();
    qrd.getQueryDateTime().getTimeOfAnEvent().setValue("20080805120000");
    return adr;
}
Also used : QRD(ca.uhn.hl7v2.model.v24.segment.QRD) MSH(ca.uhn.hl7v2.model.v24.segment.MSH) ADR_A19(ca.uhn.hl7v2.model.v24.message.ADR_A19) MSA(ca.uhn.hl7v2.model.v24.segment.MSA)

Example 7 with Segment

use of ca.uhn.hl7v2.model.Segment in project camel by apache.

the class HL7MLLPNettyCodecTest method createHL7AsMessage.

// START SNIPPET: e3
private static Message createHL7AsMessage() throws Exception {
    ADR_A19 adr = new ADR_A19();
    adr.initQuickstart("ADR", "A19", "P");
    // Populate the MSH Segment
    MSH mshSegment = adr.getMSH();
    mshSegment.getDateTimeOfMessage().getTimeOfAnEvent().setValue("200701011539");
    mshSegment.getSendingApplication().getNamespaceID().setValue("MYSENDER");
    mshSegment.getMessageControlID().setValue("456");
    // Populate the PID Segment
    MSA msa = adr.getMSA();
    msa.getAcknowledgementCode().setValue("AA");
    msa.getMessageControlID().setValue("123");
    QRD qrd = adr.getQRD();
    qrd.getQueryDateTime().getTimeOfAnEvent().setValue("20080805120000");
    return adr;
}
Also used : QRD(ca.uhn.hl7v2.model.v24.segment.QRD) MSH(ca.uhn.hl7v2.model.v24.segment.MSH) ADR_A19(ca.uhn.hl7v2.model.v24.message.ADR_A19) MSA(ca.uhn.hl7v2.model.v24.segment.MSA)

Example 8 with Segment

use of ca.uhn.hl7v2.model.Segment in project camel by apache.

the class HL7NettyRouteTest method createADR19Message.

// END SNIPPET: e2
private static Message createADR19Message() throws Exception {
    ADR_A19 adr = new ADR_A19();
    // Populate the MSH Segment
    MSH mshSegment = adr.getMSH();
    mshSegment.getFieldSeparator().setValue("|");
    mshSegment.getEncodingCharacters().setValue("^~\\&");
    mshSegment.getDateTimeOfMessage().getTimeOfAnEvent().setValue("200701011539");
    mshSegment.getSendingApplication().getNamespaceID().setValue("MYSENDER");
    mshSegment.getSequenceNumber().setValue("123");
    mshSegment.getMessageType().getMessageType().setValue("ADR");
    mshSegment.getMessageType().getTriggerEvent().setValue("A19");
    // Populate the PID Segment
    MSA msa = adr.getMSA();
    msa.getAcknowledgementCode().setValue("AA");
    msa.getMessageControlID().setValue("123");
    QRD qrd = adr.getQRD();
    qrd.getQueryDateTime().getTimeOfAnEvent().setValue("20080805120000");
    return adr.getMessage();
}
Also used : QRD(ca.uhn.hl7v2.model.v24.segment.QRD) MSH(ca.uhn.hl7v2.model.v24.segment.MSH) ADR_A19(ca.uhn.hl7v2.model.v24.message.ADR_A19) MSA(ca.uhn.hl7v2.model.v24.segment.MSA)

Example 9 with Segment

use of ca.uhn.hl7v2.model.Segment in project camel by apache.

the class HL7NettyRouteTest method createADT01Message.

private static Message createADT01Message(String msgId) throws Exception {
    ADT_A01 adt = new ADT_A01();
    // Populate the MSH Segment
    MSH mshSegment = adt.getMSH();
    mshSegment.getFieldSeparator().setValue("|");
    mshSegment.getEncodingCharacters().setValue("^~\\&");
    mshSegment.getDateTimeOfMessage().getTimeOfAnEvent().setValue("200701011539");
    mshSegment.getSendingApplication().getNamespaceID().setValue("MYSENDER");
    mshSegment.getSequenceNumber().setValue("123");
    mshSegment.getMessageType().getMessageType().setValue("ADT");
    mshSegment.getMessageType().getTriggerEvent().setValue("A01");
    // Populate the PID Segment
    PID pid = adt.getPID();
    pid.getPatientName(0).getFamilyName().getSurname().setValue("Doe");
    pid.getPatientName(0).getGivenName().setValue("John");
    pid.getPatientIdentifierList(0).getID().setValue(msgId);
    return adt;
}
Also used : MSH(ca.uhn.hl7v2.model.v24.segment.MSH) PID(ca.uhn.hl7v2.model.v24.segment.PID) ADT_A01(ca.uhn.hl7v2.model.v24.message.ADT_A01)

Example 10 with Segment

use of ca.uhn.hl7v2.model.Segment in project camel by apache.

the class HL7RouteTest method createADT01Message.

private static Message createADT01Message(String msgId) throws Exception {
    ADT_A01 adt = new ADT_A01();
    // Populate the MSH Segment
    MSH mshSegment = adt.getMSH();
    mshSegment.getFieldSeparator().setValue("|");
    mshSegment.getEncodingCharacters().setValue("^~\\&");
    mshSegment.getDateTimeOfMessage().getTimeOfAnEvent().setValue("200701011539");
    mshSegment.getSendingApplication().getNamespaceID().setValue("MYSENDER");
    mshSegment.getSequenceNumber().setValue("123");
    mshSegment.getMessageType().getMessageType().setValue("ADT");
    mshSegment.getMessageType().getTriggerEvent().setValue("A01");
    // Populate the PID Segment
    PID pid = adt.getPID();
    pid.getPatientName(0).getFamilyName().getSurname().setValue("Doe");
    pid.getPatientName(0).getGivenName().setValue("John");
    pid.getPatientIdentifierList(0).getID().setValue(msgId);
    return adt;
}
Also used : MSH(ca.uhn.hl7v2.model.v24.segment.MSH) PID(ca.uhn.hl7v2.model.v24.segment.PID) ADT_A01(ca.uhn.hl7v2.model.v24.message.ADT_A01)

Aggregations

MSH (ca.uhn.hl7v2.model.v24.segment.MSH)14 ADR_A19 (ca.uhn.hl7v2.model.v24.message.ADR_A19)10 MSA (ca.uhn.hl7v2.model.v24.segment.MSA)10 QRD (ca.uhn.hl7v2.model.v24.segment.QRD)10 ADT_A01 (ca.uhn.hl7v2.model.v24.message.ADT_A01)8 PID (ca.uhn.hl7v2.model.v24.segment.PID)8 HL7Exception (ca.uhn.hl7v2.HL7Exception)4 Group (ca.uhn.hl7v2.model.Group)4 Message (ca.uhn.hl7v2.model.Message)4 Segment (ca.uhn.hl7v2.model.Segment)4 Structure (ca.uhn.hl7v2.model.Structure)4 SegmentModel (org.talend.designer.hl7.model.SegmentModel)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 TypeModel (org.talend.designer.hl7.model.TypeModel)3 HashSet (java.util.HashSet)1 Set (java.util.Set)1 PrimitiveModel (org.talend.designer.hl7.model.PrimitiveModel)1