use of ca.uhn.hl7v2.model.v24.segment.PID in project camel by apache.
the class MessageValidatorTest method doPreSetup.
@Override
protected void doPreSetup() throws Exception {
defaultValidationContext = ValidationContextFactory.defaultValidation();
defaultContext = new DefaultHapiContext(defaultValidationContext);
// we validate separately, not during parsing or rendering
defaultContext.getParserConfiguration().setValidating(false);
ValidationRuleBuilder builder = new ValidationRuleBuilder() {
private static final long serialVersionUID = 1L;
@Override
protected void configure() {
forVersion(Version.V24).message("ADT", "A01").terser("PID-8", not(empty()));
}
};
customValidationContext = ValidationContextFactory.fromBuilder(builder);
customContext = new DefaultHapiContext(customValidationContext);
// we validate separately, not during parsing or rendering
customContext.getParserConfiguration().setValidating(false);
}
use of ca.uhn.hl7v2.model.v24.segment.PID in project camel by apache.
the class HL7MLLPNettyCodecByteArrayRouteTest 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;
}
use of ca.uhn.hl7v2.model.v24.segment.PID in project camel by apache.
the class HL7MLLPNettyCodecByteArrayRouteTest method createADR19Message.
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");
mshSegment.getCharacterSet(0).setValue("UNICODE UTF-8");
// 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();
}
use of ca.uhn.hl7v2.model.v24.segment.PID in project camel by apache.
the class HL7MLLPNettyCodecStandAndEndBytesTest method createHL7AsMessage.
private static Message createHL7AsMessage() 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;
}
use of ca.uhn.hl7v2.model.v24.segment.PID in project camel by apache.
the class HL7MLLPNettyRouteToTest 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;
}
Aggregations