/** * <p> * Inserts a specific repetition of ORDER_TRAY (a Group object) * </p> * * * @see AbstractGroup#insertRepetition(Structure, int) */ public OMD_O03_ORDER_TRAY insertORDER_TRAY(int rep) throws HL7Exception { return (OMD_O03_ORDER_TRAY)super.insertRepetition("ORDER_TRAY", rep); }
/** * <p> * Removes a specific repetition of SFT (Software Segment) * </p> * * * @see AbstractGroup#removeRepetition(String, int) */ public SFT removeSFT(int rep) throws HL7Exception { return (SFT)super.removeRepetition("SFT", rep); }
/** * {@inheritDoc } */ public Character getFieldSeparatorValue() throws HL7Exception { Segment firstSegment = (Segment) get(getNames()[0]); Primitive value = (Primitive) firstSegment.getField(1, 0); String valueString = value.getValue(); if (valueString == null || valueString.length() == 0) { return null; } return valueString.charAt(0); }
Segment msh = (Segment) get("MSH"); Version version = Version.versionOf(getVersion()); Terser.set(msh, 1, 0, 1, 1, "|"); Terser.set(msh, 2, 0, 1, 1, Version.V27.isGreaterThan(version) ? Terser.set(msh, 9, 0, 1, 1, messageCode); Terser.set(msh, 9, 0, 2, 1, messageTriggerEvent); Terser.set(msh, 10, 0, 1, 1, getParser().getParserConfiguration().getIdGenerator().getID()); Terser.set(msh, 11, 0, 1, 1, processingId); Terser.set(msh, 12, 0, 1, 1, getVersion());
/** * {@inheritDoc } */ public Message generateACK(AcknowledgmentCode theAcknowledgementCode, HL7Exception theException) throws HL7Exception, IOException { if (theException != null && theException.getResponseMessage() != null) { return theException.getResponseMessage(); } Message out = instantiateACK(); out.setParser(getParser()); fillResponseHeader(out, theAcknowledgementCode); if (theException != null) { theException.populateResponse(out, theAcknowledgementCode, 0); } return out; }
public Message createNak0(Message originalMessage, HL7Exception e, AcknowledgmentCode ackTypeCode) throws HL7Exception { AbstractMessage ack = (AbstractMessage) MessageUtils.response( originalMessage, messageType, triggerEvent); LOG.info("Creating NAK response event of type {}", ack.getClass().getName()); e.populateResponse(ack, ackTypeCode, 0); Segment msa = (Segment) ack.get("MSA"); Terser.set(msa, 1, 0, 1, 1, ackTypeCode.name()); Segment ackQak = (Segment) ack.get("QAK"); Segment origQpd = (Segment) originalMessage.get("QPD"); if (origQpd != null) { String queryTag = Terser.get(origQpd, 2, 0, 1, 1); Terser.set(ackQak, 1, 0, 1, 1, queryTag); LOG.debug("Set QAK-1 to {}", queryTag); } Terser.set(ackQak, 2, 0, 1, 1, "AE"); // create a dummy QPD segment, it will be replaced with proper contents by // org.openehealth.ipf.platform.camel.ihe.hl7v2.intercept.consumer.ConsumerSegmentEchoingInterceptor Segment ackQpd = (Segment) ack.get("QPD"); Terser.set(ackQpd, 1, 0, 1, 1, "dummy"); return ack; }
/** * {@inheritDoc} */ public String printStructure() throws HL7Exception { StringBuilder builder = new StringBuilder(); appendStructureDescription(builder, 0, false, false, true, true, true); return builder.toString(); }
/** * Provides an overview of the type and structure of this message */ @Override public String toString() { try { return encode(); } catch (HL7Exception e) { return (getClass().getName() + " - Failed to create toString(): " + e.getMessage()); } }
/** * {@inheritDoc } */ public Character getFieldSeparatorValue() throws HL7Exception { Segment firstSegment = (Segment) get(getNames()[0]); Primitive value = (Primitive) firstSegment.getField(1, 0); String valueString = value.getValue(); if (valueString == null || valueString.length() == 0) { return null; } return valueString.charAt(0); }
Segment msh = (Segment) get("MSH"); Version version = Version.versionOf(getVersion()); Terser.set(msh, 1, 0, 1, 1, "|"); Terser.set(msh, 2, 0, 1, 1, Version.V27.isGreaterThan(version) ? Terser.set(msh, 9, 0, 1, 1, messageCode); Terser.set(msh, 9, 0, 2, 1, messageTriggerEvent); Terser.set(msh, 10, 0, 1, 1, getParser().getParserConfiguration().getIdGenerator().getID()); Terser.set(msh, 11, 0, 1, 1, processingId); Terser.set(msh, 12, 0, 1, 1, getVersion());
/** * {@inheritDoc } */ public Message generateACK(AcknowledgmentCode theAcknowledgementCode, HL7Exception theException) throws HL7Exception, IOException { if (theException != null && theException.getResponseMessage() != null) { return theException.getResponseMessage(); } Message out = instantiateACK(); out.setParser(getParser()); fillResponseHeader(out, theAcknowledgementCode); if (theException != null) { theException.populateResponse(out, theAcknowledgementCode, 0); } return out; }
Segment mshIn = (Segment) get("MSH"); Segment mshOut = (Segment) out.get("MSH");
/** * Prints the message structure in a similar way to {@link #printStructure()} but * optionally excludes elements with no contents. */ public String printStructure(boolean includeEmptyElements) throws HL7Exception { StringBuilder builder = new StringBuilder(); appendStructureDescription(builder, 0, false, false, true, true, includeEmptyElements); return builder.toString(); }
/** * Provides an overview of the type and structure of this message */ @Override public String toString() { try { return encode(); } catch (HL7Exception e) { return (getClass().getName() + " - Failed to create toString(): " + e.getMessage()); } }
/** * <p> * Inserts a specific repetition of SFT (Software Segment) * </p> * * * @see AbstractGroup#insertRepetition(Structure, int) */ public void insertSFT(SFT structure, int rep) throws HL7Exception { super.insertRepetition( "SFT", structure, rep); }
/** * <p> * Removes a specific repetition of DB1 (Disability) * </p> * * * @see AbstractGroup#removeRepetition(String, int) */ public DB1 removeDB1(int rep) throws HL7Exception { return (DB1)super.removeRepetition("DB1", rep); }
Segment mshIn = (Segment) get("MSH"); Segment mshOut = (Segment) out.get("MSH");