Examples of ORU_R01


Examples of ca.uhn.hl7v2.model.v25.message.ORU_R01

     *             If any processing problem occurs
     */
    public static void main(String[] args) throws HL7Exception {

        // First, a message object is constructed
        ORU_R01 message = new ORU_R01();

        // A few basic MSH fields are populated. In a real situation, this would not be enough
        // to produce a valid message, but for demonstration purposes we'll skip a few
        // fields.
        message.getMSH().getEncodingCharacters().setValue("^~\\&");
        message.getMSH().getFieldSeparator().setValue("|");

        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");
View Full Code Here

Examples of ca.uhn.hl7v2.model.v25.message.ORU_R01

       
        // We can also use the terser to set values
        terser.set("/.MSH-3-1", "new_sending_app");
       
        // Let's try something more complicated, adding values to an OBX in an ORU^R01
        ORU_R01 oru = new ORU_R01();
        oru.getMSH().getEncodingCharacters().setValue("^~\\&");
        oru.getMSH().getFieldSeparator().setValue("|");
        oru.getMSH().getMessageType().getMessageCode().setValue("ORU");
        oru.getMSH().getMessageType().getTriggerEvent().setValue("R01");
        oru.getMSH().getVersionID().getVersionID().setValue("2.5");
       
        terser = new Terser(oru);
        for (int i = 0; i < 5; i++) {
            terser.set("/PATIENT_RESULT/ORDER_OBSERVATION/OBSERVATION(" + i + ")/OBX-1", "" + (i + 1));
            terser.set("/PATIENT_RESULT/ORDER_OBSERVATION/OBSERVATION(" + i + ")/OBX-3", "ST");
View Full Code Here

Examples of ca.uhn.hl7v2.model.v25.message.ORU_R01

     * @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");
View Full Code Here

Examples of ca.uhn.hl7v2.model.v25.message.ORU_R01

       
        // We can also use the terser to set values
        terser.set("/.MSH-3-1", "new_sending_app");
       
        // Let's try something more complicated, adding values to an OBX in an ORU^R01
        ORU_R01 oru = new ORU_R01();
        oru.getMSH().getEncodingCharacters().setValue("^~\\&");
        oru.getMSH().getFieldSeparator().setValue("|");
        oru.getMSH().getMessageType().getMessageCode().setValue("ORU");
        oru.getMSH().getMessageType().getTriggerEvent().setValue("R01");
        oru.getMSH().getVersionID().getVersionID().setValue("2.5");
       
        terser = new Terser(oru);
        for (int i = 0; i < 5; i++) {
            terser.set("/PATIENT_RESULT/ORDER_OBSERVATION/OBSERVATION(" + i + ")/OBX-1", "" + (i + 1));
            terser.set("/PATIENT_RESULT/ORDER_OBSERVATION/OBSERVATION(" + i + ")/OBX-3", "ST");
View Full Code Here

Examples of ca.uhn.hl7v2.model.v26.message.ORU_R01

    String string = "MSH|^~\\&|ULTRA|TML|OLIS|OLIS|200905011130||ORU^R01|20169838|T|2.3\r"
      + "PID|||7005728\r"
      + "OBR|1\r"
      + "OBX|||||Sample Value\r";

    ORU_R01 msg = new ORU_R01();
    try {
      // This throws an exception
      msg.parse(string);
    } catch (Exception e) {
      e.printStackTrace();
      /*
       * Prints:
       * ca.uhn.hl7v2.HL7Exception: OBX-5 is valued, but OBX-2 is not.  A datatype for OBX-5 must be specified using OBX-2. See JavaDoc for Varies#fixOBX5(Segment, ModelClassFactory)
       * at ca.uhn.hl7v2.model.Varies.fixOBX5(Varies.java:189)
       * at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:377)
       * at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:1009)
       * at ca.uhn.hl7v2.model.AbstractMessage.parse(AbstractMessage.java:189)
       * at ca.uhn.hl7v2.examples.ParseInvalidObx2Values.main(ParseInvalidObx2Values.java:28)
       */
    }
   
    /*
     * Setting the following system property allows you to specify a default
     * value to assume if OBX-2 is missing.
     */   
    System.setProperty(Varies.DEFAULT_OBX2_TYPE_PROP, "ST");

    // Parsing now succeeds
    msg = new ORU_R01();
    msg.parse(string);

   
   
    /*
     * The following message has an invalid value in OBX-2
     */
    string = "MSH|^~\\&|ULTRA|TML|OLIS|OLIS|200905011130||ORU^R01|20169838|T|2.3\r"
      + "PID|||7005728\r"
      + "OBR|1\r"
      + "OBX||BAD|||Sample Value\r";
   
    msg = new ORU_R01();
    try {
      // This throws an exception
      msg.parse(string);
    } catch (Exception e) {
      e.printStackTrace();
      /*
       * Prints:
       * ca.uhn.hl7v2.HL7Exception: 'BAD' in record null is invalid for version 2.6. See JavaDoc for Varies#fixOBX5(Segment, ModelClassFactory): Segment: OBX Field #2
       * at ca.uhn.hl7v2.model.Varies.fixOBX5(Varies.java:212)
       * at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:377)
       * at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:1009)
       * at ca.uhn.hl7v2.model.AbstractMessage.parse(AbstractMessage.java:189)
       * at ca.uhn.hl7v2.examples.ParseInvalidObx2Values.main(ParseInvalidObx2Values.java:62)
       */
    }
   
    /*
     * Setting the following system property allows you to specify a default
     * value to assume if OBX-2 is missing.
     */   
    System.setProperty(Varies.INVALID_OBX2_TYPE_PROP, "ST");

    // Parsing now succeeds
    msg = new ORU_R01();
    msg.parse(string);
   
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.