private MSH getMSH(ORU_R01 oru) { return oru.getMSH(); }
private PID getPID(ORU_R01 oru) { return oru.getPATIENT_RESULT().getPATIENT().getPID(); }
ORU_R01 message = new ORU_R01(); message.getMSH().getEncodingCharacters().setValue("^~\\&"); message.getMSH().getFieldSeparator().setValue("|"); ORU_R01_ORDER_OBSERVATION orderObservation = message.getPATIENT_RESULT().getORDER_OBSERVATION();
/** * <p> * Returns * DSC (Continuation Pointer) - creates it if necessary * </p> * * */ public DSC getDSC() { return getTyped("DSC", DSC.class); }
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");
/** * <p> * Returns the number of existing repetitions of SFT * </p> * */ public int getSFTReps() { return getReps("SFT"); }
/** * <p> * Returns a non-modifiable List containing all current existing repetitions of SFT. * <p> * <p> * Note that unlike {@link #getSFT()}, this method will not create any reps * if none are already present, so an empty list may be returned. * </p> * */ public java.util.List<SFT> getSFTAll() throws HL7Exception { return getAllAsList("SFT", SFT.class); }
/** * Creates a new ORU_R01 message with custom ModelClassFactory. */ public ORU_R01(ModelClassFactory factory) { super(factory); init(factory); }
private void init(ModelClassFactory factory) { try { this.add(MSH.class, true, false); this.add(SFT.class, false, true); this.add(ORU_R01_PATIENT_RESULT.class, true, true); this.add(DSC.class, false, false); } catch(HL7Exception e) { log.error("Unexpected error creating ORU_R01 - this is probably a bug in the source code generator.", e); } }
/** * <p> * Returns * the first repetition of * SFT (Software Segment) - creates it if necessary * </p> * * */ public SFT getSFT() { return getTyped("SFT", SFT.class); }
/** * <p> * Returns the number of existing repetitions of SFT * </p> * */ public int getSFTReps() { return getReps("SFT"); }
/** * <p> * Returns a non-modifiable List containing all current existing repetitions of PATIENT_RESULT. * <p> * <p> * Note that unlike {@link #getPATIENT_RESULT()}, 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_PATIENT_RESULT> getPATIENT_RESULTAll() throws HL7Exception { return getAllAsList("PATIENT_RESULT", ORU_R01_PATIENT_RESULT.class); }
/** * Creates a new ORU_R01 message with custom ModelClassFactory. */ public ORU_R01(ModelClassFactory factory) { super(factory); init(factory); }
private void init(ModelClassFactory factory) { try { this.add(MSH.class, true, false); this.add(SFT.class, false, true); this.add(ORU_R01_PATIENT_RESULT.class, true, true); this.add(DSC.class, false, false); } catch(HL7Exception e) { log.error("Unexpected error creating ORU_R01 - this is probably a bug in the source code generator.", e); } }
private ORC getORC(ORU_R01 oru) { return oru.getPATIENT_RESULT().getORDER_OBSERVATION().getORC(); }
/** * <p> * Returns * the first repetition of * PATIENT_RESULT (a Group object) - creates it if necessary * </p> * * */ public ORU_R01_PATIENT_RESULT getPATIENT_RESULT() { return getTyped("PATIENT_RESULT", ORU_R01_PATIENT_RESULT.class); }
/** * @see ORUR01Handler#getForm(MSH) */ @Test public void getForm_shouldPassIfReturnValueIsNotNullWhenUuidOrIdIsNotNull() throws Exception { String hl7String = "MSH|^~\\&|FORMENTRY|AMRS.ELD|HL7LISTENER|AMRS.ELD|20090728170332||ORU^R01|gu99yBh4loLX2mh9cHaV|P|2.5|1||||||||16^AMRS.ELD.FORMID\r" + "PID|||3^^^^||Beren^John^Bondo||\r" + "NK1|1|Jones^Jane^Lee^^RN|3A^Parent^99REL||||||||||||F|19751016|||||||||||||||||2^^^L^PI\r" + "PV1||O|1^Unknown||||1^Super User (admin)|||||||||||||||||||||||||||||||||||||20090714|||||||V\r" + "ORC|RE||||||||20090728165937|1^Super User\r" + "OBR|1|||1238^MEDICAL RECORD OBSERVATIONS^99DCT\r" + "OBX|2|NM|5497^CD4 COUNT^99DCT||123|||||||||20090714\r" + "OBR|3|||23^FOOD CONSTRUCT^99DCT\r" + "OBX|1|CWE|21^FOOD ASSISTANCE FOR ENTIRE FAMILY^99DCT||22^UNKNOWN^99DCT^2471^UNKNOWN^99NAM|||||||||20090714"; ORUR01Handler oruHandler = new ORUR01Handler(); Message hl7message = parser.parse(hl7String); ORU_R01 oru = (ORU_R01) hl7message; ca.uhn.hl7v2.model.v25.segment.MSH msh = oru.getMSH(); Form form = oruHandler.getForm(msh); Assert.assertNotNull(form); } }
/** * <p> * Returns the number of existing repetitions of PATIENT_RESULT * </p> * */ public int getPATIENT_RESULTReps() { return getReps("PATIENT_RESULT"); }
/** * <p> * Returns a non-modifiable List containing all current existing repetitions of PATIENT_RESULT. * <p> * <p> * Note that unlike {@link #getPATIENT_RESULT()}, 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_PATIENT_RESULT> getPATIENT_RESULTAll() throws HL7Exception { return getAllAsList("PATIENT_RESULT", ORU_R01_PATIENT_RESULT.class); }
/** * finds NK1 segments in an ORU_R01 message. all HAPI-rendered Messages have at least one NK1 * segment but if the original message truly does not contain an NK1, the setID will be null on * the generated NK1 * * @param oru ORU_R01 message to be parsed for NK1 segments * @return list of not-null NK1 segments * @throws HL7Exception */ public List<NK1> getNK1List(ORU_R01 oru) throws HL7Exception { List<NK1> res = new ArrayList<>(); // there will always be at least one NK1, even if the original message does not contain one for (int i = 0; i < oru.getPATIENT_RESULT().getPATIENT().getNK1Reps(); i++) { // if the setIDNK1 value is null, this NK1 is blank if (oru.getPATIENT_RESULT().getPATIENT().getNK1(i).getSetIDNK1().getValue() != null) { res.add(oru.getPATIENT_RESULT().getPATIENT().getNK1(i)); } } return res; }