public ApplicationRouterImpl(HapiContext theContext) { this(theContext, theContext.getGenericParser()); }
public ApplicationRouterImpl(HapiContext theContext) { this(theContext, theContext.getGenericParser()); }
public GenericParser getGenericParser() { return context.getGenericParser(); }
public GenericParser getGenericParser() { return context.getGenericParser(); }
/** * @param theHapiContext HapiContext */ public HL7Service(HapiContext theHapiContext) { this(theHapiContext.getGenericParser(), theHapiContext.getLowerLayerProtocol(), theHapiContext.getExecutorService()); }
/** * @param theHapiContext HapiContext */ public HL7Service(HapiContext theHapiContext) { this(theHapiContext.getGenericParser(), theHapiContext.getLowerLayerProtocol(), theHapiContext.getExecutorService()); }
/** * Parses the string to an {@link UnmodifiableMessage} using the specific HapiContext. When accessing structures or types of the * returned message, they will be unmodifiable as well. The returned message caches the original message string, * which is returned when calling {@link Message#encode()} or {@link Message#toString()}. * * @param context HapiContext * @param s message string * @return unmodifiable message wrapper * @throws HL7Exception if parsing fails */ public static Message unmodifiableMessage(HapiContext context, String s) throws HL7Exception { Message msg = context.getGenericParser().parse(s); return new UnmodifiableMessage(msg, s); }
/** * Parses the string to an {@link UnmodifiableMessage} using the specific HapiContext. When accessing structures or types of the * returned message, they will be unmodifiable as well. The returned message caches the original message string, * which is returned when calling {@link Message#encode()} or {@link Message#toString()}. * * @param context HapiContext * @param s message string * @return unmodifiable message wrapper * @throws HL7Exception if parsing fails */ public static Message unmodifiableMessage(HapiContext context, String s) throws HL7Exception { Message msg = context.getGenericParser().parse(s); return new UnmodifiableMessage(msg, s); }
public class Test { static Terser pcd01 = null; @BeforeClass public static void getData() throws Exception { // Make the connection to PM.service TCPServer tc = new TCPServer(); String [] values = tc.returnData(); // Make the terser and return it. HapiContext context = new DefaultHapiContext(); Parser p = context.getGenericParser(); Message hapiMsg = p.parse(data); pcd01 = new Terser(hapiMsg); } @Test public void test_1() throws Exception { // Do stuff with pcd01 } @Test public void test_2() throws Exception { // Do stuff with pcd01 } @Test public void test_3() throws Exception { // Do stuff with pcd01 } }
/** * @since 2.2 */ public Connection attachLazily(String host, int outboundPort, int inboundPort, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, outboundPort, inboundPort, getHapiContext() .getGenericParser(), getHapiContext().getLowerLayerProtocol(), tls, getHapiContext().getSocketFactory(), true)); }
/** * @since 2.2 */ public Connection attachLazily(String host, int outboundPort, int inboundPort, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, outboundPort, inboundPort, getHapiContext() .getGenericParser(), getHapiContext().getLowerLayerProtocol(), tls, getHapiContext().getSocketFactory(), true)); }
/** * @since 2.0 */ public Connection attach(String host, int outboundPort, int inboundPort, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, outboundPort, inboundPort, getHapiContext() .getGenericParser(), getHapiContext().getLowerLayerProtocol(), tls, getHapiContext().getSocketFactory(), false)); }
/** * @since 2.0 */ public Connection attach(String host, int outboundPort, int inboundPort, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, outboundPort, inboundPort, getHapiContext() .getGenericParser(), getHapiContext().getLowerLayerProtocol(), tls, getHapiContext().getSocketFactory(), false)); }
/** * Returns a Connection to the given address, opening this Connection if necessary. The given * Parser will only be used if a new Connection is opened, so there is no guarantee that the * Connection returned will be using the Parser you provide. If you need explicit access to the * Parser the Connection is using, call <code>Connection.getParser()</code>. * * @since 2.2 */ public Connection attachLazily(String host, int port, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, port, 0, getHapiContext().getGenericParser(), getHapiContext().getLowerLayerProtocol(), tls, getHapiContext() .getSocketFactory(), true)); }
/** * Returns a Connection to the given address, opening this Connection if necessary. The given * Parser will only be used if a new Connection is opened, so there is no guarantee that the * Connection returned will be using the Parser you provide. If you need explicit access to the * Parser the Connection is using, call <code>Connection.getParser()</code>. * * @since 2.1 */ public Connection attach(String host, int port, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, port, 0, getHapiContext().getGenericParser(), getHapiContext().getLowerLayerProtocol(), tls, getHapiContext() .getSocketFactory(), false)); }
/** * Returns a Connection to the given address, opening this Connection if necessary. The given * Parser will only be used if a new Connection is opened, so there is no guarantee that the * Connection returned will be using the Parser you provide. If you need explicit access to the * Parser the Connection is using, call <code>Connection.getParser()</code>. * * @since 2.2 */ public Connection attachLazily(String host, int port, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, port, 0, getHapiContext().getGenericParser(), getHapiContext().getLowerLayerProtocol(), tls, getHapiContext() .getSocketFactory(), true)); }
/** * Returns a Connection to the given address, opening this Connection if necessary. The given * Parser will only be used if a new Connection is opened, so there is no guarantee that the * Connection returned will be using the Parser you provide. If you need explicit access to the * Parser the Connection is using, call <code>Connection.getParser()</code>. * * @since 2.1 */ public Connection attach(String host, int port, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, port, 0, getHapiContext().getGenericParser(), getHapiContext().getLowerLayerProtocol(), tls, getHapiContext() .getSocketFactory(), false)); }
/** * Generates an empty response message. This class generates an * ACKnowledgement using the code returned by {@link #getSuccessAcknowledgementCode()}. * * @param request request message, either a {@link String} or a * {@link Message} * @return acknowledgment to the request * @throws HL7Exception */ protected Message generateResponseMessage(Object request) throws HL7Exception { try { Message in; if (request instanceof String) { Segment s = getHapiContext().getGenericParser().getCriticalResponseData( (String)request); in = s.getMessage(); DeepCopy.copy(s, (Segment) in.get("MSH")); } else if (request instanceof Message) { in = (Message) request; } else { throw new HL7Exception("Validated message must be either Message or String"); } return in.generateACK(getSuccessAcknowledgementCode(), null); } catch (IOException e) { throw new HL7Exception(e); } }
/** * Generates an empty response message. This class generates an * ACKnowledgement using the code returned by {@link #getSuccessAcknowledgementCode()}. * * @param request request message, either a {@link String} or a * {@link Message} * @return acknowledgment to the request * @throws HL7Exception */ protected Message generateResponseMessage(Object request) throws HL7Exception { try { Message in; if (request instanceof String) { Segment s = getHapiContext().getGenericParser().getCriticalResponseData( (String)request); in = s.getMessage(); DeepCopy.copy(s, (Segment) in.get("MSH")); } else if (request instanceof Message) { in = (Message) request; } else { throw new HL7Exception("Validated message must be either Message or String"); } return in.generateACK(getSuccessAcknowledgementCode(), null); } catch (IOException e) { throw new HL7Exception(e); } }