0

I'm really new on Hapi HL7 an used the example Server Class.

public static void main(String[] args) throws Exception {
    HapiContext context = new DefaultHapiContext();
    MinLowerLayerProtocol mllp = new MinLowerLayerProtocol();
    mllp.setCharset("UTF-8");
    context.setLowerLayerProtocol(mllp);


    int port = 2010; // The port to listen on
    boolean useTls = false; // Should we use TLS/SSL?

    HL7Service server = context.newServer(port, useTls);

    ReceivingApplication handler = new ExampleReceiverApplication();


    server.registerApplication("*", "*", handler);
    server.registerConnectionListener(new MyConnectionListener());

    server.setExceptionHandler(new MyExceptionHandler());

    server.startAndWait();

}

Now I want to catch the receiving message for further handle... How can I do this?

tckmn
  • 57,719
  • 27
  • 114
  • 156

1 Answers1

0

Take a close look at the example provided by HAPI

ReceivingApplication handler = new ExampleReceiverApplication(); 

This class can handle the incoming message

Szymon
  • 42,577
  • 16
  • 96
  • 114
  • Hi, danke für deine Antwort. Ich habe mittlerweile selbst die Lösung gefunden. Ich habe mir einen eigenen Receiving Applikation Handler geschrieben und diesen wie folgt integriert. server.registerApplication("ADT", "A01", new MyHandler()); Mein Handler orientiert sich nach dem Beispielhandler (Expample'), nur dass ich so auch die empfangenen Nachrichten auswerten kann. Danke – GGK stands for Ukraine Dec 02 '13 at 20:01