From: Michael H. <mh...@st...> - 2004-05-27 20:54:08
|
Hi. I'm having a problem parsing v2.1 messages. Here's a sample msg: MSH|^~\&|LABS|SHS|PLW||20040517101834||ORU^R01|20041030000744|P|2.1||||^ MPID|||61000999^^^1||PIE^CHERRY^||19870606|F|^ ^|||||||||00000000000^0|654-99 -9999|^MPV1||OP|BMT^||||125^Donald^Duck^A|^||||||||||ROP6||||||||||||||| |||||||||||2004 03230000||^MORC|RE|290746||||||||||008888^Unassigned^Doctor^|||^MOBR||29 0746||UA^URINALYSIS WITH MICROSCOPIC|||2004051 71003|||||||200405171012|^|008888^Unassigned^Doctor^||||M5053||||U|F|UA^ UA|^ONCE^^200405171003^^R|^~^~^|||||||^MOBX|1| ST|SPECMN^Specimen|1|Random|---| ||||F|||200405171013|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|2|ST|UCOL^Color| 1|Yellow|---| ||||F|||200405171017|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|3|ST|UCLAR^Clarity|1|Clear|---| ||||F|||200405171017|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|4|ST|USPG^Specific Gravity|1|1.020|---|1.001-1.035|| ||F|||200405171017|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|5|ST|UGLU^Glucose|1|Negative|--- |NEG||||F|||20040517101 7|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|6|ST|UKET^Ketone|1|Negative|--- |NEG||||F|||200405171017|H^Heme Receipt|9 997^LABPRINT^TRAINING|^MOBX|7|ST|UBLO^Blood|1|Negative|--- |NEG||||F|||200405171017|H^Heme Receipt|9997^LABPRINT^TRAINI NG|^MOBX|8|ST|UPH^pH|1|5.0|---|5.0-8.0||||F|||200405171017|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|9|ST|UPROT^Prot ein|1|Negative|---|NEG||||F|||200405171017|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|10|ST|UNIT^Nitrite|1|Negative|- --|NEG||||F|||200405171017|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|11|ST|ULEU^Leuk esterase|1|Negative|---|NEG|||| F|||200405171017|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|12|ST|URBC^RBC, urine|1|Not Detected|/HPF|0-5||||F|||2004 05171017|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|13|ST|UWBC^WBC, urine|1|Not Detected|/HPF|0-5||||F|||200405171017 |H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|14|ST|UBAC^Bacteria|1|No significant amount of bacteria detected. Correla tion with microbiology|---| ||||F|||200405171017|H^Heme Receipt|9997^LABPRINT^TRAINING|^MOBX|14|FT|UBAC^Bacteria|2 | culture as indicated.|---| |||||||200405171017|H^Heme Receipt|9997^LABPRINT^TRAINING| When I parse it and spit out the xml using the xml parser, the PID segment (from the fake name above; PIE^CHERRY) looks like this: <PID> <PID.3>61000999</PID.3> <PID.5>PIE</PID.5> <PID.7>19870606</PID.7> <PID.8>F</PID.8> <PID.18>00000000000</PID.18> <PID.19>654-99-9999</PID.19> </PID> Notice that it dropped half the name (pid.5 segment) on the floor; actually it dropped every compound field on the floor. If I manually change the msg version to 2.2 by editing the MSG segment of the msg, then it looks right: <PID> <PID.3> <CM_PAT_ID.1>61000999</CM_PAT_ID.1> <CM_PAT_ID.4>1</CM_PAT_ID.4> </PID.3> <PID.5> <PN.1>PIE</PN.1> <PN.2>CHERRY</PN.2> </PID.5> <PID.7>19870606</PID.7> <PID.8>F</PID.8> <PID.18> <CK_PAT_ID.1>00000000000</CK_PAT_ID.1> <CK_PAT_ID.2>0</CK_PAT_ID.2> </PID.18> <PID.19>654-99-9999</PID.19> </PID> Uh... is there something malformed in the v2.1 message? Or is something wrong in hapi's v2.1 grammar/parsing? Thanks for any help/info. Mike Harm mh...@st... ---------------------------------------------------- "Use grammar different." |