use of ca.uhn.hl7v2.model.Message 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;
}
use of ca.uhn.hl7v2.model.Message in project camel by apache.
the class MessageValidatorTest method testDynamicCustomHapiContext.
@Test(expected = CamelExecutionException.class)
public void testDynamicCustomHapiContext() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:test6");
mock.expectedMessageCount(0);
Message msg = createADT01Message();
msg.setParser(customContext.getPipeParser());
template.sendBody("direct:test6", msg);
assertMockEndpointsSatisfied();
}
use of ca.uhn.hl7v2.model.Message in project camel by apache.
the class MessageValidatorTest method testDefaultValidationContext.
@Test
public void testDefaultValidationContext() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:test1");
mock.expectedMessageCount(1);
Message msg = createADT01Message();
template.sendBody("direct:test1", msg);
assertMockEndpointsSatisfied();
}
use of ca.uhn.hl7v2.model.Message in project camel by apache.
the class MessageValidatorTest method testDynamicDefaultHapiContext.
@Test
public void testDynamicDefaultHapiContext() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:test6");
mock.expectedMessageCount(1);
Message msg = createADT01Message();
msg.setParser(defaultContext.getPipeParser());
template.sendBody("direct:test6", msg);
assertMockEndpointsSatisfied();
}
use of ca.uhn.hl7v2.model.Message 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;
}
Aggregations