* @throws IOException
*/
public static void main(String[] args) throws HL7Exception, IOException {
// First, a message object is constructed
ORU_R01 message = new ORU_R01();
/*
* The initQuickstart method populates all of the mandatory fields in the
* MSH segment of the message, including the message type, the timestamp,
* and the control ID.
*/
message.initQuickstart("ORU", "R01", "T");
/*
* The OBR segment is contained within a group called ORDER_OBSERVATION,
* which is itself in a group called PATIENT_RESULT. These groups are
* reached using named accessors.
*/
ORU_R01_ORDER_OBSERVATION orderObservation = message.getPATIENT_RESULT().getORDER_OBSERVATION();
// Populate the OBR
OBR obr = orderObservation.getOBR();
obr.getSetIDOBR().setValue("1");
obr.getFillerOrderNumber().getEntityIdentifier().setValue("1234");