From: Ian V. <Ian...@he...> - 2014-11-12 00:57:32
|
In our team I often use the phrase “printStructure is your friend!”. If you think something like this might be happening, output a printStructure after parsing and you will see exactly where your segments are, and the DG1, DG12, DG13 James has referred to will be very apparent, as will anything considered to be ‘non-standard’. This has revealed vendors sending what look to be sensible messages with standard segments which are NOT following the standard. NTE segments being thrown into unexpected places in ORM/ORU messages have given us some trouble in the past. printStructure is your friend ☺ Ian From: James Agnew [mailto:jam...@gm...] Sent: Wednesday, 12 November 2014 10:21 AM To: Hasson, Laurent Cc: HAPI Devel List; Singh, Brijesh Subject: Re: [HAPI-devel] DG1 segments repetition. Correct. It's unintuitive for sure, but unfortunately because of the way ER7 encoding works, there is no way to tell that these pairs are a repeating group and not just two unrelated segments of the same name (like the two PID segments in an A17). James sent from my phone. On Nov 11, 2014 6:36 PM, "Hasson, Laurent" <Ha...@ad...<mailto:Ha...@ad...>> wrote: So, this is essentially expected behavior Vs. A bug? Laurent Hasson Managing Director, Realtime Clinical Systems, Strategy and Engineering The Advisory Board Company - www.advisory.com<http://www.advisory.com> Cell: 646-283-2186<tel:646-283-2186> Sent from my BlackBerry Passport. From: James Agnew Sent: Tuesday, November 11, 2014 17:16 To: Singh, Brijesh Cc: hl7...@li...<mailto:hl7...@li...> Subject: Re: [HAPI-devel] DG1 segments repetition. Hi Brijesh, You're right, the custom segments are causing an issue since the parser csn't see subsequent DG1 repetitions as actual repetitions. The easiest way to do this would be to call MessageInstance.getAll("DG1") followed by MessageInstance.getAll("DG12") followed by MessageInstance.getAll("DG13") etc.. Basically HAPI creates nonstandard segments for each of the following DG1s by adding a sequential number to the end. If you wanted to be more fancy, you could create a custom structure that has a group containing the custom segment as well, or you could override the parser and use string maniulation to remove the Z-segments before parsing.. But the method above is definitely the least work. Incidentally MessageInstance.getNames() will give you the names of all the segments (including the "DG1[number]" ones) so you will know how many there are. Cheers, James On Tue, Nov 11, 2014 at 2:06 PM, Singh, Brijesh <Si...@ad...<mailto:Si...@ad...>> wrote: Hi – I’m using HAPI library(2.2) to parse the below message and calling the method getAll(“DG1”) ( Structure[] Structs = MessageInstance.getAll(“DG1”) ) to retrieve the DG1 segments. I’m having issues getting all DG1 segments. From the below message, able to retrieve only one DG1 segment. Looks like the custom segment (ZDG) is in the middle of repeating DG1 segments and breaking the repetition. Can you please suggest if I can use other API methods to retrieve all DG1 ( 3 in the below case) ignoring ZDG segments? Thanks for your help. MSH|^~\&|SCM|SCM|HL7ADT||20130114001147||ADT^A08|8456356603013|P|2.3 PID||5012223067<tel:5012223067>^^^Corporate Num|50730137^^^EAST MRN|300000003^^^EID|Moose^Bullwinkle^J||19091011|F||1|1 Roanoke St^^New York^NY^11111^USA^Home||(888)111-1111^^^^^888^111-1111^^Home|^^^^^^^^Cellular|ENG|W|CA|3000000039^^^EAST MRN|111165812|11119791||Hispanic Origin NK1|1|Bugs^Bee|19||(888)111-1111^^^^^888^111-1111^^Home||Emergency PV1||E|ERM^^^EAST MRN|Emergency|||N20714^Chris^Bob^Bruce~1907828742^^^^^^^^^^^^NPI|||REH||||Non-Health Care||0||Emergency|3000000039^^^EAST MRN|||||||||||||||||||||Clean||||20130115001000 PV2||^N|ABDOMINAL PAIN NAUSEA COLD SYM OBX|1|ST|Intolerances||None Entered||||||X DG1|1||^CHEST PAIN DEHYDRATION NAUSE|CHEST PAIN DEHYDRATION NAUSE||Visit Reason ZDG|1||^CHEST PAIN DEHYDRATION NAUSE|CHEST PAIN DEHYDRATION NAUSE||Visit Reason DG1|2||^CHEST PAIN DEHYDRATION NAUSE|CHEST PAIN DEHYDRATION NAUSE||Visit Reason ZDG|2||^CHEST PAIN DEHYDRATION NAUSE|CHEST PAIN DEHYDRATION NAUSE||Visit Reason DG1|3||^CHEST PAIN DEHYDRATION NAUSE|CHEST PAIN DEHYDRATION NAUSE||Visit Reason ZDG|3||^CHEST PAIN DEHYDRATION NAUSE|CHEST PAIN DEHYDRATION NAUSE||Visit Reason OBX|2|ST|Allergies||See Allergy Icon/Pt Info Tab||||||X AL1|1|Drug|quinolone antibiotics^^^^23^Multum|Swelling|facial swelling ZAL||||AL|Swelling AL1|2|Drug|quinolone topicals^^^^70^Multum|Swelling|facial swelling ZAL||||AL|Swelling IN1|1||BLUE|BLUE CROSS^MEDICARE|PO BOX 880031^^Boston^MA^02201||(888)111-1111^^^^^888^111-1111||||||||Medicare|Bugs^Bunny^M|18|19000928|1 Roanoke St^^New York^NY^11111^USA||||||||||||||||||||||||Male||||||1112223067 IN2||475846521|DISABLED||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||(888)111-1111^^Phone^^^888^111-1111|||||||DISABLED Regards, Brijesh Singh ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk _______________________________________________ Hl7api-devel mailing list Hl7...@li...<mailto:Hl7...@li...> 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. ********************************************************************************** |