We are in the same boat as James, and created a "super structure".
Using the MWB was the path I planned to take, but unfortunately I have,
to this day, not figured out how to make MWB work. I wrote the "super
structure" in java using HAPI.
I would be very grateful if someone could point me to a beginner's
guide to the MWB, because I reckon it would be the better way to go
about dealing with site or vendor specific message types.
Thanks
Ian
>>> James Agnew <ja...@jamesagnew.ca> 11/01/13 3:26 >>>
For what it's worth, I'll mention how University Health Network deals
with this.
We do a whole lot of ADT interfacing with one specific system, so we
created an XML conformance profile using Message Workbench that contains
all of the needed segments. In other words, we started with an ADT_A01
structure, then added all of the missing segments in order to process
all messages we need to process (MRG, the second PID in an A17, etc.).
This gave us a kind of "super structure" that could be used to access
any ADT message.
We then use a maven plugin to translate that conformance profile into
HAPI structure classes as described here (
http://hl7api.sourceforge.net/conformance.html ).
This way of doing things is definitely by far the most work to get set
up, but once you have it set up you certainly have nice clean readable
code, since you don't need parser tricks or whatever else.
I should really document this whole process start to finish at some
point. Maybe it would make sense to include an ADT "super structure" in
the base HAPI release for just this purpose..
James
On Thu, Jan 10, 2013 at 9:48 AM, Carlos Oliva <carl...@pbsinet.com>
wrote:
How would you examine repetitive segments with the Preparser? To carry
out a completely generic parsing, one could retrieve data with the
preparser like Christian mentioned.
One problem might be with several instances of the same segment in one
message. How would you retrieve the fields from all these segments?
From: steven touw [mailto:tou...@gmail.com]
Sent: Thursday, January 10, 2013 8:20 AM
To: Laurent Hasson
Cc: hl7api-devel@lists.sourceforge.net
Subject: Re: [HAPI-devel] reading HL7 generically
Thank you all, very helpful.
On Thu, Jan 10, 2013 at 7:55 AM, Laurent Hasson <l...@360fresh.com>
wrote:
This is the kind of code we have been using for that purpose:
try
{
_PID = new HL7PID((PID)Msg.get("PID"));
}
catch (HL7Exception E) { }
try
{
Segment segment = (Segment)Msg.get("PV1");
if (segment != null)
_PV = new HL7PV((PV1)segment, (PV2)Msg.get("PV2"));
}
catch (HL7Exception E) { }
try
{
Structure[] Structs = Msg.getAll("DG1");
if (Structs != null && Structs.length > 0)
{
_DG1 = new HL7DG1[Structs.length];
for (int i = 0; i < Structs.length; ++i)
_DG1[i] = new HL7DG1((DG1)Structs[i]);
}
}
catch (HL7Exception E) { }
We do a few things:
- We have our own structures to capture the elements of a particular
message we care about (here, HL7PID, HL7DG1 etc*)
- We have try-catch blocks because HAPI can throw an exception if the
segment doesn*t exist.
This has been working ok for us.
___________________________________________________________
Laurent Hasson
Co-Founder and CTO
360Fresh Inc.
cell: 646.283.2186 ( tel:646.283.2186 )
"Strange women lyin' in ponds distributin' swords is no basis for a
system of government" - Dennis
This e-mail may contain confidential and/or privileged information.
This information is intended only for the use of the individual(s) and
entity(ies) to whom it is addressed. If you are the intended recipient,
further disclosures are prohibited without proper authorization. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden and possibly a violation of federal or
state law and regulations.
-----Original Message-----
From: Christian Ohr [mailto:christian....@gmail.com]
Sent: Thursday, January 10, 2013 2:58 AM
To: steven touw
Cc: hl7api-devel@lists.sourceforge.net
Subject: Re: [HAPI-devel] reading HL7 generically
Forgot to mention that you currently still need to include the
hapi-structure jar(s) in your classpath, depending on the HL7
version(s) you expect. You can also use the CanonicalModelClassFactory
with your parser, then you only need the latest structure jar.
In HAPI 2.1 (not released yet), you will be able to omit the structure
jars completely.
Christian
2013/1/10 Christian Ohr <christian....@gmail.com>:
> In general, you don't have to cast to a specific message structure
> class: the parser returns a Message object, and you can obtain
> segments using message.get("segment-name") , and from a Segment you
> can obtain a field using segment.getField(field-number). If that's
not
> generic enough, take a look at ca.uhn.hl7v2.preparser.PreParser.
>
> cheers
> Christian
>
> 2013/1/9 steven touw <tou...@gmail.com>:
>> Hello,
>> I am new to HL7 as well as it's contents. I hope this question isn't
>> too stupid.
>> I'm trying to read from messages generically - is there any way to
>> grab particular segments without having to cast the Message object
>> into ADT_A05 for example? I could have various ADT_* and trying to
>> find the best way to do this...
>>
>> Thanks,
>> Steve
>>
>>
---------------------------------------------------------------------
>> --------- Master Java SE, Java EE, Eclipse, Spring, Hibernate,
>> JavaScript, jQuery and much more. Keep your Java skills current with
>> LearnJavaNow -
>> 200+ hours of step-by-step video tutorials by Java experts.
>> SALE $49.99 this month only -- learn more at:
>> http://p.sf.net/sfu/learnmore_122612
>> _______________________________________________
>> Hl7api-devel mailing list
>> Hl7api-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>>
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs
and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills
current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills
current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel
********************************************************************************
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.
**********************************************************************************
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel