use of ca.uhn.hl7v2.model.v24.message.ADT_A01 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;
}
use of ca.uhn.hl7v2.model.v24.message.ADT_A01 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;
}
use of ca.uhn.hl7v2.model.v24.message.ADT_A01 in project camel by apache.
the class HL7ValidateTest 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.getPhoneNumberBusiness(0).getPhoneNumber().setValue("333123456");
pid.getPatientIdentifierList(0).getID().setValue("123456");
return adt;
}
use of ca.uhn.hl7v2.model.v24.message.ADT_A01 in project camel by apache.
the class AckExpressionTest method testNakExpressionWithoutException.
@Test
public void testNakExpressionWithoutException() throws Exception {
ADT_A01 a01 = createADT01Message();
ACK ack = template.requestBody("direct:test5", a01, ACK.class);
assertEquals("AR", ack.getMSA().getAcknowledgementCode().getValue());
assertEquals(a01.getMSH().getMessageControlID().getValue(), ack.getMSA().getMessageControlID().getValue());
assertEquals(String.valueOf(ErrorCode.DATA_TYPE_ERROR.getCode()), ack.getERR().getErrorCodeAndLocation(0).getCodeIdentifyingError().getIdentifier().getValue());
assertEquals("Problem!", ack.getERR().getErrorCodeAndLocation(0).getCodeIdentifyingError().getAlternateText().getValue());
}
use of ca.uhn.hl7v2.model.v24.message.ADT_A01 in project camel by apache.
the class AckExpressionTest method createADT01Message.
private static ADT_A01 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;
}