Search in sources :

Example 1 with ADT_A01

use of ca.uhn.hl7v2.model.v24.message.ADT_A01 in project camel by apache.

the class AckExpressionTest method testAckExpression.

@Test
public void testAckExpression() throws Exception {
    ADT_A01 a01 = createADT01Message();
    ACK ack = template.requestBody("direct:test1", a01, ACK.class);
    assertEquals("AA", ack.getMSA().getAcknowledgementCode().getValue());
    assertEquals(a01.getMSH().getMessageControlID().getValue(), ack.getMSA().getMessageControlID().getValue());
}
Also used : ACK(ca.uhn.hl7v2.model.v24.message.ACK) ADT_A01(ca.uhn.hl7v2.model.v24.message.ADT_A01) Test(org.junit.Test)

Example 2 with ADT_A01

use of ca.uhn.hl7v2.model.v24.message.ADT_A01 in project camel by apache.

the class AckExpressionTest method testNakExpressionWithParameters.

@Test
public void testNakExpressionWithParameters() throws Exception {
    ADT_A01 a01 = createADT01Message();
    ACK ack = template.requestBody("direct:test4", a01, ACK.class);
    assertEquals("AR", ack.getMSA().getAcknowledgementCode().getValue());
    assertEquals(a01.getMSH().getMessageControlID().getValue(), ack.getMSA().getMessageControlID().getValue());
    assertEquals(String.valueOf(ErrorCode.APPLICATION_INTERNAL_ERROR.getCode()), ack.getERR().getErrorCodeAndLocation(0).getCodeIdentifyingError().getIdentifier().getValue());
    assertEquals("Problem!", ack.getERR().getErrorCodeAndLocation(0).getCodeIdentifyingError().getAlternateText().getValue());
}
Also used : ACK(ca.uhn.hl7v2.model.v24.message.ACK) ADT_A01(ca.uhn.hl7v2.model.v24.message.ADT_A01) Test(org.junit.Test)

Example 3 with ADT_A01

use of ca.uhn.hl7v2.model.v24.message.ADT_A01 in project camel by apache.

the class HL7ByteArrayRouteTest 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");
    mshSegment.getCharacterSet(0).setValue("UNICODE UTF-8");
    // Populate the PID Segment
    PID pid = adt.getPID();
    pid.getPatientName(0).getFamilyName().getSurname().setValue("Döe");
    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 4 with ADT_A01

use of ca.uhn.hl7v2.model.v24.message.ADT_A01 in project camel by apache.

the class MessageValidatorTest method createADT01Message.

private static Message createADT01Message() throws Exception {
    ADT_A01 adt = new ADT_A01();
    adt.initQuickstart("ADT", "A01", "P");
    // 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("123456");
    return adt;
}
Also used : PID(ca.uhn.hl7v2.model.v24.segment.PID) ADT_A01(ca.uhn.hl7v2.model.v24.message.ADT_A01)

Example 5 with ADT_A01

use of ca.uhn.hl7v2.model.v24.message.ADT_A01 in project camel by apache.

the class TerserExpressionTest method createADT01Message.

private static Message createADT01Message() throws Exception {
    ADT_A01 adt = new ADT_A01();
    adt.initQuickstart("ADT", "A01", "P");
    // 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(PATIENT_ID);
    return adt;
}
Also used : PID(ca.uhn.hl7v2.model.v24.segment.PID) ADT_A01(ca.uhn.hl7v2.model.v24.message.ADT_A01)

Aggregations

ADT_A01 (ca.uhn.hl7v2.model.v24.message.ADT_A01)13 PID (ca.uhn.hl7v2.model.v24.segment.PID)8 ACK (ca.uhn.hl7v2.model.v24.message.ACK)5 Test (org.junit.Test)5 MSH (ca.uhn.hl7v2.model.v24.segment.MSH)4