Examples of ReceivingApplication


Examples of ca.uhn.hl7v2.protocol.ReceivingApplication

    /**
     * @see ca.uhn.hl7v2.protocol.ApplicationRouter#hasActiveBinding(ca.uhn.hl7v2.protocol.ApplicationRouter.AppRoutingData)
     */
    public boolean hasActiveBinding(AppRoutingData theRoutingData) {
        boolean result = false;
        ReceivingApplication app = findDestination(theRoutingData);
        if (app != null) {
            result = true;
        }
        return result;
    }
View Full Code Here

Examples of ca.uhn.hl7v2.protocol.ReceivingApplication

    /**
     * @param theRoutingData
     * @return the application from the binding with a WILDCARD match, if one exists
     */
    private ReceivingApplication findDestination(AppRoutingData theRoutingData) {
        ReceivingApplication result = null;
        for (int i = 0; i < myBindings.size() && result == null; i++) {
            Binding binding = (Binding) myBindings.get(i);
            if (matches(theRoutingData, binding.routingData) && binding.active) {
                result = binding.application;
            }
View Full Code Here

Examples of ca.uhn.hl7v2.protocol.ReceivingApplication

    private ReceivingApplication findApplication(Message theMessage) throws HL7Exception {
        Terser t = new Terser(theMessage);
        AppRoutingData msgData =
            new AppRoutingDataImpl(t.get("/MSH-9-1"), t.get("/MSH-9-2"), t.get("/MSH-11-1"), t.get("/MSH-12"));
           
        ReceivingApplication app = findDestination(msgData);
       
        //have to send back an application reject if no apps available to process
        if (app == null)
            app = new AppWrapper(new DefaultApplication());
        return app;
View Full Code Here

Examples of ca.uhn.hl7v2.protocol.ReceivingApplication

                        HL7Exception.APPLICATION_INTERNAL_ERROR);
                }

                Class<?> appClass = Class.forName(className); //may throw ClassNotFoundException
                Object appObject = appClass.newInstance();
                ReceivingApplication app = null;
                if (appObject instanceof ReceivingApplication) {
                    app = (ReceivingApplication) appObject;
                } else if (appObject instanceof Application) {
                    app = new AppWrapper((Application) appObject);
                } else {
View Full Code Here

Examples of ca.uhn.hl7v2.protocol.ReceivingApplication

                    ParseChecker.checkParse(incomingMessageString, incomingMessageObject, myParser);
                }
               
                //message validation (in terms of optionality, cardinality) would go here ***
               
                ReceivingApplication app = findApplication(incomingMessageObject);
                theMetadata.put(RAW_MESSAGE_KEY, incomingMessageString);
               
                log.debug("Sending message to application: {}", app.toString());
                Message response = app.processMessage(incomingMessageObject, theMetadata);
               
                //Here we explicitly use the same encoding as that of the inbound message - this is important with GenericParser, which might use a different encoding by default
                outgoingMessageString = myParser.encode(response, myParser.getEncoding(incomingMessageString));
               
                Terser t = new Terser(response);
View Full Code Here

Examples of ca.uhn.hl7v2.protocol.ReceivingApplication

                            + "*** NOTE TWO NEW FIELDS AS OF HAPI 0.5 ****. ");
                }

                Class<?> appClass = Class.forName(className); //may throw ClassNotFoundException
                Object appObject = appClass.newInstance();
                ReceivingApplication app = null;
                if (appObject instanceof ReceivingApplication) {
                    app = (ReceivingApplication) appObject;
                } else if (appObject instanceof Application) {
                    app = new AppWrapper((Application) appObject);
                } else {
View Full Code Here

Examples of ca.uhn.hl7v2.protocol.ReceivingApplication

   * over-writes the previous one. Note that the wildcard "*" for messageType
   * or triggerEvent means any type or event, respectively.
   */
  public synchronized void registerApplication(String messageType,
      String triggerEvent, Application handler) {
    ReceivingApplication handlerWrapper = new AppWrapper(handler);
    applicationRouter.bindApplication(new AppRoutingDataImpl(messageType, triggerEvent, "*", "*"), handlerWrapper);
  }
View Full Code Here

Examples of ca.uhn.hl7v2.protocol.ReceivingApplication

                    ParseChecker.checkParse(incomingMessageString, incomingMessageObject, myParser);
                }
               
                //message validation (in terms of optionality, cardinality) would go here ***
               
                ReceivingApplication app = findApplication(incomingMessageObject);
                theMetadata.put(RAW_MESSAGE_KEY, incomingMessageString);
               
                log.debug("Sending message to application: {}", app.toString());
                Message response = app.processMessage(incomingMessageObject, theMetadata);
               
                //Here we explicitly use the same encoding as that of the inbound message - this is important with GenericParser, which might use a different encoding by default
                outgoingMessageString = myParser.encode(response, myParser.getEncoding(incomingMessageString));
               
                Terser t = new Terser(response);
View Full Code Here

Examples of ca.uhn.hl7v2.protocol.ReceivingApplication

    /**
     * @see ca.uhn.hl7v2.protocol.ApplicationRouter#hasActiveBinding(ca.uhn.hl7v2.protocol.ApplicationRouter.AppRoutingData)
     */
    public boolean hasActiveBinding(AppRoutingData theRoutingData) {
        boolean result = false;
        ReceivingApplication app = findDestination(null, theRoutingData);
        if (app != null) {
            result = true;
        }
        return result;
    }
View Full Code Here

Examples of ca.uhn.hl7v2.protocol.ReceivingApplication

    /**
     * @param theRoutingData
     * @return the application from the binding with a WILDCARD match, if one exists
     */
    private ReceivingApplication findDestination(Message theMessage, AppRoutingData theRoutingData) {
        ReceivingApplication result = null;
        for (int i = 0; i < myBindings.size() && result == null; i++) {
            Binding binding = (Binding) myBindings.get(i);
            if (matches(theRoutingData, binding.routingData) && binding.active) {
              if (theMessage == null || binding.application.canProcess(theMessage)) {
                result = binding.application;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.