Hi,

Thanks for the response. The think is i need to find the port in the 
MyApplication. Is there any way?

Thanks
Ram

On 03/05/2012 10:25 PM, hl7api-devel-requ...@lists.sourceforge.net wrote:
> Send Hl7api-devel mailing list submissions to
>       hl7api-devel@lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
>       https://lists.sourceforge.net/lists/listinfo/hl7api-devel
> or, via email, send a message with subject or body 'help' to
>       hl7api-devel-requ...@lists.sourceforge.net
>
> You can reach the person managing the list at
>       hl7api-devel-ow...@lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Hl7api-devel digest..."
>
>
> Today's Topics:
>
>     1. Re: "Path" expressions? (LDH)
>     2. How to get the Port of the current connection (Ram)
>     3. Re: How to get the Port of the current connection (LDH)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 20 Feb 2012 23:29:58 -0500
> From: LDH<l...@360fresh.com>
> Subject: Re: [HAPI-devel] "Path" expressions?
> To: hl7api-devel@lists.sourceforge.net
> Message-ID:<4f431dc6.6020...@360fresh.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Thank you, i think that may be what i was looking for.
>
> ------------------------------------------------------------------------
> *Laurent (Harry) Hasson*
> 360Fresh
>
>
> On 2/16/2012 22:41, Ian Vowles wrote:
>> What you are after is the terser.  Cut and pasted snippets below.
>> Since the structure of the ORM is rather deep, I included some
>> additional strings to make it easier.  The example I extracted this
>> from uses a properties file that has a database column name as the
>> key, and the datatype and terse destination as the value, like this:
>> MESSAGE_TYPE=VARCHAR2|MSH-9-1
>> TRIGGER_EVENT=VARCHAR2|MSH-9-2
>> PATIENT_CLASS=VARCHAR2|PV1-2
>> ORDER_CONTROL=VARCHAR2|ORC-1
>> ORDER_STATUS=VARCHAR2|ORC-5
>> CLI_ID=NUMBER|PID-3
>> CLI_LAST_NAME=VARCHAR2|PID-5-1
>> CLI_FIRST_NAME=VARCHAR2|PID-5-2
>> CLI_OTHER_NAMES=VARCHAR2|PID-5-3
>> CLI_TITLE=VARCHAR2|PID-5-5
>> CLI_BIRTH_DATE=DATE|PID-7
>> I split the value on the pipe, make some format decisions using the
>> datatype, and put the value into the nominated field with the terser.
>> The deeper and somewhat odd looking terser keys can be seen if you
>> create a message of a particular type and do a printstructure.
>> With the message object and it's terser you can use both the technique
>> you have shown, and the terser interchangeably to construct your message.
>> You mention that there are differences from hospital to hospital,
>> which I have seen with content, but seldom with structure.  If the
>> hospital doesn't follow the HL7 standard in it's structure, you may
>> have to build custom messages. If they just put funny content in, you
>> can use either of these techniques to get at the content, and do what
>> you need.
>> Note this code is a few lines cut from a running interface, just to
>> show the use.  It's not in any way complete. It doiesn't show the loop
>> through the columns of the recordset object of the database source to
>> fill the entire message. The MSH segment is filled out using the
>> hl7Out.getMSH().getVersionID().getVersionID().setValue("2.3.1");
>> technique.
>> import ca.uhn.hl7v2.HL7Exception;
>> import ca.uhn.hl7v2.model.DataTypeException;
>> import ca.uhn.hl7v2.model.v231.message.ORM_O01;
>> import ca.uhn.hl7v2.parser.CustomModelClassFactory;
>> import ca.uhn.hl7v2.parser.ModelClassFactory;
>> import ca.uhn.hl7v2.util.Terser;
>>              ModelClassFactory cmf = new
>> CustomModelClassFactory("au.gov.qld.health.sit.bsqr");
>>              ORM_O01 hl7Out = new ORM_O01(cmf);
>>              System.out.println(hl7Out.printStructure());
>>              Terser terser = new Terser(hl7Out);
>>              String pidTerse = "/PIDPD1NTEPV1PV2IN1IN2IN3GT1AL1";
>>              String pv1Terse = "/PIDPD1NTEPV1PV2IN1IN2IN3GT1AL1/PV1PV2";
>>              String orcTerse =
>> "/ORCOBRRQDRQ1ODSODTRXONTEDG1RXRRXCNTEOBXNTECTIBLG";
>>              String obrTerse = orcTerse +
>> "/OBRRQDRQ1ODSODTRXONTEDG1RXRRXCNTEOBXNTE";
>>
>>               if (!mobileStationName.equalsIgnoreCase("unknown")) {
>>                      terser.set(obrTerse + "/OBR-21", mobileStationName);
>>               }
>>
>> Best of luck
>> Ian
>>
>>
>>
>>>>> LDH<l...@360fresh.com>  17/02/12 12:37>>>
>> I just worked on a project which used Mirth, and in the mapping code,
>> we'd do something like
>>
>>      var PatientGivenName = msg['PID.5.2'].toString();
>>
>> I have been searching the docs and samples online to find a way to
>> access values from "path expressions" like the above, but without
>> success. A quick pointer would be so useful.
>>
>> The reason why i am researching this is that i'd like eventually to
>> have a simple configuration file that would provide simple mappings
>> which could then be modified without changing code. Currently, i'd get
>> the field with the following code:
>>
>>      ADT_A01 ADT = (ADT_A01) Msg;
>>      ADT.getPID().getPatientName(0).getGivenName().getValue();
>>
>> Clearly, for FirstName, that is unlikely to change, but some other
>> values seem to vary a lot from hospital to hospital and would like my
>> doce to be more flexible and driven by a simple mapping configuration.
>>
>> Thank you.
>> Laurent Hasson
>> 360Fresh
>>
>> ********************************************************************************
>>
>> This email, including any attachments sent with it, is confidential
>> and for the sole use of the intended recipient(s). This
>> confidentiality is not waived or lost, if you receive it and you are
>> not the intended recipient(s), or if it is transmitted/received in error.
>>
>> Any unauthorised use, alteration, disclosure, distribution or review
>> of this email is strictly prohibited. The information contained in
>> this email, including any attachment sent with it, may be subject to a
>> statutory duty of confidentiality if it relates to health service matters.
>>
>> If you are not the intended recipient(s), or if you have received this
>> email in error, you are asked to immediately notify the sender by
>> telephone collect on Australia +61 1800 198 175 or by return email.
>> You should also delete this email, and any copies, from your computer
>> system network and destroy any hard copies produced.
>>
>> If not an intended recipient of this email, you must not copy,
>> distribute or take any action(s) that relies on it; any form of
>> disclosure, modification, distribution and/or publication of this
>> email is also prohibited.
>>
>> Although Queensland Health takes all reasonable steps to ensure this
>> email does not contain malicious software, Queensland Health does not
>> accept responsibility for the consequences if any person's computer
>> inadvertently suffers any disruption to services, loss of information,
>> harm or is infected with a virus, other malicious computer programme
>> or code that may occur as a consequence of receiving this email.
>>
>> Unless stated otherwise, this email represents only the views of the
>> sender and not the views of the Queensland Government.
>>
>> **********************************************************************************
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Virtualization&   Cloud Management Using Capacity Planning
>> Cloud computing makes use of virtualization - but cloud computing
>> also focuses on allowing computing to be delivered as a service.
>> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>>
>>
>> _______________________________________________
>> Hl7api-devel mailing list
>> Hl7api-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 2
> Date: Mon, 05 Mar 2012 21:28:29 +0530
> From: Ram<r...@visolve.com>
> Subject: [HAPI-devel] How to get the Port of the current connection
> To: hl7api-devel@lists.sourceforge.net
> Message-ID:<4f54e2a5.3080...@visolve.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>    Hi All,
>
> I did created a MyApplication which implements Application interface.
> Then i had a situation to get the port of the connection which received
> the message. So I implemented the ConnectionListener interface. When
> trying to implement the connectionReceived() method, i could able to
> find the method
>
>
> Thanks
> Ram
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 05 Mar 2012 11:55:24 -0500
> From: LDH<l...@360fresh.com>
> Subject: Re: [HAPI-devel] How to get the Port of the current
>       connection
> To: hl7api-devel@lists.sourceforge.net
> Message-ID:<4f54effc.7080...@360fresh.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Sorry but i am not sure i understand your message clearly. If you are
> talking about creating a listener and ingesting messages, this is the
> kind of code i have. When your application starts, you have to create a
> listener on a port.
>
>          int PORT= 12345; // Generally through some configuration file or
> command line
>          LowerLayerProtocol llp = LowerLayerProtocol.makeLLP(); // The
> transport protocol
>          PipeParser parser = new PipeParser(); // The message parser
>          HL7Listener = new SimpleServer(PORT, llp, parser);
>          Application handler = new HL7ListenerApp();
>          HL7Listener.registerApplication("*", "*", handler);
>          HL7Listener.start();
>          System.out.println("HL7 daemon has been started on port "+PORT);
>
> Then the Listener class is fairly simple:
>
>      public class HL7ListenerApp implements Application
>        {
>          public HL7ListenerApp()
>           {
>              // Do your initialization
>           }
>
>          @Override
>          public boolean canProcess(Message arg0)
>           {
>             return true;
>           }
>
>          @Override
>          public Message processMessage(Message Msg)
>          throws ApplicationException, HL7Exception
>           {
>             Message ACK = null;
>             try
>              {
>                 // parse the Msg
>                 if (no error)
>                  {
>                    ACK = DefaultApplication.makeACK((MSH) Msg.get("MSH"));
>                    // persist the message if you need to
>                    // Handle message info (write to file, db, or update
>      UI or whatever you need to do
>                  }
>                 else
>                  {
>                    // handle error
>                  }
>              }
>             catch (Throwable T)
>              {
>                if (ACK == null)
>                 throw new HL7Exception(T);
>              }
>             return ACK;
>           }
>        }
>
> I have implemented this in a number of places and prefer to handle the
> error in the application than bubble it up back to the interface, unless
> something really bad happened (HL7Exception). I hope this helps although
> i am not sure this is exactly what you asked for.
>
> ------------------------------------------------------------------------
> *Laurent (Harry) Hasson*
> Co-Founder, 360Fresh.com<https://360Fresh.com>
>
>
> On 3/5/2012 10:58, Ram wrote:
>>     Hi All,
>>
>> I did created a MyApplication which implements Application interface.
>> Then i had a situation to get the port of the connection which received
>> the message. So I implemented the ConnectionListener interface. When
>> trying to implement the connectionReceived() method, i could able to
>> find the method
>>
>>
>> Thanks
>> Ram
>>
>> ------------------------------------------------------------------------------
>> Try before you buy = See our experts in action!
>> The most comprehensive online learning library for Microsoft developers
>> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
>> Metro Style Apps, more. Free future releases when you subscribe now!
>> http://p.sf.net/sfu/learndevnow-dev2
>> _______________________________________________
>> Hl7api-devel mailing list
>> Hl7api-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
>
> ------------------------------
>
> _______________________________________________
> Hl7api-devel mailing list
> Hl7api-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>
>
> End of Hl7api-devel Digest, Vol 68, Issue 1
> *******************************************
>


------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to