Hi Ian,

There are two options here. The traditional way is to use "custom
packages". To do this, you create your custom structure, call it "ORU_R01",
put it in a specific package and create a property file that points to it.
There is a description of this functionality here:

http://hl7api.sourceforge.net/apidocs/ca/uhn/hl7v2/parser/DefaultModelClassFactory.html#packageList%28java.lang.String%29

One other way you might look to do this is with a new implementation of a
ModelClassFactory which always instantiates your structure and then passing
it to the parser that your SimpleServer uses. If you only ever receive this
one type of message on this particular interface, this is probably your far
easier option. (Incidentally, if you do this and happen to want to
contribute back an example, we would certainly welcome that :) )

Cheers,
James

On Thu, May 17, 2012 at 12:58 AM, Ian Vowles
<ian_vow...@health.qld.gov.au>wrote:

>  We have a vendor who sends us non-standard messages which resemble ORU
> R01, and the MSH states that they are ORU R01.
>
> A class to represent the message has been built, and it works well, except
> when we want to use it in the processMessage method of a SimpleServer.
> processMessage requires the message to be Message, which throws an
> exception if we try to cast it to our specific message class.
>
> Whilst we can get things working by encoding the Message object and
> parsing the result with our specific implementation, this doesn't feel
> light the 'right way' to do it.
>
> How can we get the messageProcessor method to deal with our specific
> message implementation?
>
> Thanks
> Ian
>
>
> ********************************************************************************
>
> 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.
>
>
> **********************************************************************************
>
>
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Hl7api-devel mailing list
> Hl7api-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to