/** * <p> * Returns a non-modifiable List containing all current existing repetitions of TIMING_QTY. * <p> * <p> * Note that unlike {@link #getTIMING_QTY()}, this method will not create any reps * if none are already present, so an empty list may be returned. * </p> */ public java.util.List<ORU_R01_TIMING_QTY> getTIMING_QTYAll() throws HL7Exception { return getAllAsList("TIMING_QTY", ORU_R01_TIMING_QTY.class); }
OBR obr = orderObs.getOBR(); int totalNTEs = parent.getNTEReps(); for (int iNTE = 0; iNTE < totalNTEs; iNTE++) { for (FT obxComment : parent.getNTE(iNTE).getComment()) { if (comments.length() > 0) { comments.append(" "); int numObs = orderObs.getOBSERVATIONReps(); HL7Exception errorInHL7Queue = null; for (int j = 0; j < numObs; j++) { OBX obx = orderObs.getOBSERVATION(j).getOBX(); try { log.debug("Parsing observation");
private ORC getORC(ORU_R01 oru) { return oru.getPATIENT_RESULT().getORDER_OBSERVATION().getORC(); }
/** * Returns * OBR (Observation Request) - creates it if necessary */ public OBR getOBR() { OBR retVal = getTyped("OBR", OBR.class); return retVal; }
/** * Returns the number of existing repetitions of FT1 */ public int getFT1Reps() { return getReps("FT1"); }
OBR obr = orderObservation.getOBR(); obr.getSetIDOBR().setValue("1"); obr.getFillerOrderNumber().getEntityIdentifier().setValue("1234"); OBX obx = orderObservation.getOBSERVATION(0).getOBX(); obx.getSetIDOBX().setValue("1"); obx.getObservationIdentifier().getIdentifier().setValue("88304"); obx = orderObservation.getOBSERVATION(1).getOBX(); obx.getSetIDOBX().setValue("2"); obx.getObservationSubID().setValue("1");
/** * Creates a new ORU_R01_ORDER_OBSERVATION group */ public ORU_R01_ORDER_OBSERVATION(Group parent, ModelClassFactory factory) { super(parent, factory); init(factory); }
private void init(ModelClassFactory factory) { try { this.add(ORC.class, false, false, false); this.add(OBR.class, true, false, false); this.add(NTE.class, false, true, false); this.add(ORU_R01_TIMING_QTY.class, false, true, false); this.add(CTD.class, false, false, false); this.add(ORU_R01_OBSERVATION.class, false, true, false); this.add(FT1.class, false, true, false); this.add(CTI.class, false, true, false); this.add(ORU_R01_SPECIMEN.class, false, true, false); } catch(HL7Exception e) { log.error("Unexpected error creating ORU_R01_ORDER_OBSERVATION - this is probably a bug in the source code generator.", e); } }
/** * Returns * the first repetition of * SPECIMEN (a Group object) - creates it if necessary */ public ORU_R01_SPECIMEN getSPECIMEN() { ORU_R01_SPECIMEN retVal = getTyped("SPECIMEN", ORU_R01_SPECIMEN.class); return retVal; }
/** * Returns the number of existing repetitions of TIMING_QTY */ public int getTIMING_QTYReps() { return getReps("TIMING_QTY"); }
/** * Creates a new ORU_R01_ORDER_OBSERVATION group */ public ORU_R01_ORDER_OBSERVATION(Group parent, ModelClassFactory factory) { super(parent, factory); init(factory); }
private void init(ModelClassFactory factory) { try { this.add(ORC.class, false, false, false); this.add(OBR.class, true, false, false); this.add(NTE.class, false, true, false); this.add(ORU_R01_TIMING_QTY.class, false, true, false); this.add(CTD.class, false, false, false); this.add(ORU_R01_OBSERVATION.class, false, true, false); this.add(FT1.class, false, true, false); this.add(CTI.class, false, true, false); this.add(ORU_R01_SPECIMEN.class, false, true, false); } catch(HL7Exception e) { log.error("Unexpected error creating ORU_R01_ORDER_OBSERVATION - this is probably a bug in the source code generator.", e); } }
/** * Returns a specific repetition of * NTE (Notes and Comments) - creates it if necessary * * @param rep The repetition index (0-indexed, i.e. the first repetition is at index 0) * @throws HL7Exception if the repetition requested is more than one * greater than the number of existing repetitions. */ public NTE getNTE(int rep) { NTE retVal = getTyped("NTE", rep, NTE.class); return retVal; }
/** * <p> * Returns a non-modifiable List containing all current existing repetitions of FT1. * <p> * <p> * Note that unlike {@link #getFT1()}, this method will not create any reps * if none are already present, so an empty list may be returned. * </p> */ public java.util.List<FT1> getFT1All() throws HL7Exception { return getAllAsList("FT1", FT1.class); }
/** * Returns the number of existing repetitions of NTE */ public int getNTEReps() { return getReps("NTE"); }
/** * @throws HL7Exception * @see HL7Service#resolveUserId(ca.uhn.hl7v2.model.v25.datatype.XCN) */ @Test public void resolveUserId_shouldReturnUserUsingFirstAndLastNameGivenUserIDIsNull() throws HL7Exception { HL7Service hl7service = Context.getHL7Service(); //construct a message such that id Number at ORC is null Message message = hl7service .parseHL7String("MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20080226102656||ORU^R01|JqnfhKKtouEz8kzTk6Zo|P|2.5|1||||||||16^AMRS.ELD.FORMID\r" + "PID|||3^^^^||John3^Doe^||\r" + "NK1|1|Hornblower^Horatio^L|2B^Sibling^99REL||||||||||||M|19410501|||||||||||||||||1000^^^L^PN||||\r" + "ORC|RE||||||||20080226102537|^Otterbourg^Bruno\r" + "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r" + "OBX|1|NM|5497^CD4, BY FACS^99DCT||450|||||||||20080206\r" + "OBX|2|DT|5096^RETURN VISIT DATE^99DCT||20080229|||||||||20080212"); ORU_R01 oru = (ORU_R01) message; ORC orc = oru.getPATIENT_RESULT().getORDER_OBSERVATION().getORC(); XCN xcn = orc.getEnteredBy(0); Integer userId = hl7service.resolveUserId(xcn); assertThat(userId, is(501)); }
/** * Returns * CTD (Contact Data) - creates it if necessary */ public CTD getCTD() { CTD retVal = getTyped("CTD", CTD.class); return retVal; }
/** * <p> * Returns a non-modifiable List containing all current existing repetitions of SPECIMEN. * <p> * <p> * Note that unlike {@link #getSPECIMEN()}, this method will not create any reps * if none are already present, so an empty list may be returned. * </p> */ public java.util.List<ORU_R01_SPECIMEN> getSPECIMENAll() throws HL7Exception { return getAllAsList("SPECIMEN", ORU_R01_SPECIMEN.class); }
/** * Returns the number of existing repetitions of SPECIMEN */ public int getSPECIMENReps() { return getReps("SPECIMEN"); }
/** * @throws HL7Exception * @see HL7Service#resolveUserId(ca.uhn.hl7v2.model.v25.datatype.XCN) */ @Test public void resolveUserId_shouldReturnUserUsingUsername() throws HL7Exception { HL7Service hl7service = Context.getHL7Service(); //construct a message such that id Number at ORC is null Message message = hl7service .parseHL7String("MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20080226102656||ORU^R01|JqnfhKKtouEz8kzTk6Zo|P|2.5|1||||||||16^AMRS.ELD.FORMID\r" + "PID|||3^^^^||John3^Doe^||\r" + "NK1|1|Hornblower^Horatio^L|2B^Sibling^99REL||||||||||||M|19410501|||||||||||||||||1000^^^L^PN||||\r" + "ORC|RE||||||||20080226102537|^butch\r" + "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r" + "OBX|1|NM|5497^CD4, BY FACS^99DCT||450|||||||||20080206\r" + "OBX|2|DT|5096^RETURN VISIT DATE^99DCT||20080229|||||||||20080212"); ORU_R01 oru = (ORU_R01) message; ORC orc = oru.getPATIENT_RESULT().getORDER_OBSERVATION().getORC(); XCN xcn = orc.getEnteredBy(0); Integer userId = hl7service.resolveUserId(xcn); assertThat(userId, is(502)); } }