/** * {@inheritDoc } */ public String encode() throws HL7Exception { return getParser().encode(this); }
/** * {@inheritDoc } */ public String encode() throws HL7Exception { return getParser().encode(this); }
HapiContext context = new DefaultHapiContext(); Parser parser = context.getPipeParser(); String encodedMessage = parser.encode(msg); logger.debug("Printing EREncoded Message:"); logger.debug(encodedMessage);
System.out.println(parser.encode(message));
throws HL7Exception, IOException { log.info("ParseChecker is checking parse integrity (turn this off if you are not testing)"); String newMessageText = parser.encode(parsedMessage);
throws HL7Exception, IOException { log.info("ParseChecker is checking parse integrity (turn this off if you are not testing)"); String newMessageText = parser.encode(parsedMessage);
System.out.println("Got message of type " + mess.getClass().getName()); String otherEncoding = outParser.encode(mess); System.out.println(otherEncoding);
/** * {@inheritDoc } */ @Override public String encode(Message source) throws HL7Exception { if (myLegacyMode != null && myLegacyMode) { @SuppressWarnings("deprecation") OldPipeParser oldPipeParser = new OldPipeParser(getFactory()); return oldPipeParser.encode(source); } return super.encode(source); }
System.out.println("Got message of type " + mess.getClass().getName()); String otherEncoding = outParser.encode(mess); System.out.println(otherEncoding);
/** * {@inheritDoc } */ @Override public String encode(Message source) throws HL7Exception { if (myLegacyMode != null && myLegacyMode) { @SuppressWarnings("deprecation") OldPipeParser oldPipeParser = new OldPipeParser(getFactory()); return oldPipeParser.encode(source); } return super.encode(source); }
s = (String) body; } else if(body instanceof ca.uhn.hl7v2.model.Message) { s = parser.encode((ca.uhn.hl7v2.model.Message) body); } else if(body instanceof File) { s = readFile(body, charset);
outgoingMessageString = myParser.encode(response, myParser.getEncoding(incomingMessageString));
String outbound = conn.getParser().encode(out); rawOutbound.debug(outbound); Future<String> inbound = null;
String outbound = conn.getParser().encode(out); rawOutbound.debug(outbound); Future<String> inbound = null;
private static Transportable makeAcceptAck(Transportable theMessage, String theAckCode, ErrorCode theErrorCode, String theDescription) throws HL7Exception { Segment header = ourParser.getCriticalResponseData(theMessage.getMessage()); Message dummy = header.getMessage(); // MSH header refers to dummy, but not the other way round! DeepCopy.copy(header, (Segment)dummy.get("MSH")); try { HL7Exception hl7e = new HL7Exception(theDescription, theErrorCode); AcknowledgmentCode code = theAckCode == null ? AcknowledgmentCode.CR : AcknowledgmentCode.valueOf(theAckCode); Message out = dummy.generateACK(code, hl7e); String originalEncoding = ourParser.getEncoding(theMessage.getMessage()); String ackText = ourParser.encode(out, originalEncoding); return new TransportableImpl(ackText); } catch (IOException e) { throw new HL7Exception(e); } }
private static Transportable makeAcceptAck(Transportable theMessage, String theAckCode, ErrorCode theErrorCode, String theDescription) throws HL7Exception { Segment header = ourParser.getCriticalResponseData(theMessage.getMessage()); Message dummy = header.getMessage(); // MSH header refers to dummy, but not the other way round! DeepCopy.copy(header, (Segment)dummy.get("MSH")); try { HL7Exception hl7e = new HL7Exception(theDescription, theErrorCode); AcknowledgmentCode code = theAckCode == null ? AcknowledgmentCode.CR : AcknowledgmentCode.valueOf(theAckCode); Message out = dummy.generateACK(code, hl7e); String originalEncoding = ourParser.getEncoding(theMessage.getMessage()); String ackText = ourParser.encode(out, originalEncoding); return new TransportableImpl(ackText); } catch (IOException e) { throw new HL7Exception(e); } }
/** * @see ca.uhn.hl7v2.protocol.Initiator#sendAndReceive(ca.uhn.hl7v2.model.Message) */ public Message sendAndReceive(Message theMessage) throws HL7Exception { Terser t = new Terser(theMessage); String appAckNeeded = t.get("/MSH-16"); String msgId = t.get("/MSH-10"); String messageText = getParser().encode(theMessage); Map<String, Object> metadata = getMetadata(theMessage); Transportable out = new TransportableImpl(messageText, metadata); if (needAck(appAckNeeded)) { myProcessor.reserve(msgId, getReceiveTimeout()); } myProcessor.send(out, getMaxRetries(), getRetryInterval()); Message in = null; if (needAck(appAckNeeded)) { Transportable received = myProcessor.receive(msgId, getReceiveTimeout()); if (received != null && received.getMessage() != null) { in = getParser().parse(received.getMessage()); } } return in; }
/** * @see ca.uhn.hl7v2.protocol.Initiator#sendAndReceive(ca.uhn.hl7v2.model.Message) */ public Message sendAndReceive(Message theMessage) throws HL7Exception { Terser t = new Terser(theMessage); String appAckNeeded = t.get("/MSH-16"); String msgId = t.get("/MSH-10"); String messageText = getParser().encode(theMessage); Map<String, Object> metadata = getMetadata(theMessage); Transportable out = new TransportableImpl(messageText, metadata); if (needAck(appAckNeeded)) { myProcessor.reserve(msgId, getReceiveTimeout()); } myProcessor.send(out, getMaxRetries(), getRetryInterval()); Message in = null; if (needAck(appAckNeeded)) { Transportable received = myProcessor.receive(msgId, getReceiveTimeout()); if (received != null && received.getMessage() != null) { in = getParser().parse(received.getMessage()); } } return in; }