Share

HAPI

Tracker: Bugs

7 Error parsing ADT_A17 XML message - ID: 2164291
Last Update: Settings changed ( jamesagnew )

When I parse the attached ADT_A17 XML file using the 0.5.1 Message Tester,
the ER7 that is generated incorrectly duplicates the PID and PVI segments
and adds "22" to the segment names.


Gerald Bortis ( gerald_bortis ) - 2008-10-13 18:59

7

Closed

Fixed

Nobody/Anonymous

None

None

Public


Comments ( 3 )

Date: 2009-06-13 17:10
Sender: jamesagnewProject Admin

Thank you both for your patches, these have been applied.

Cheers!


Date: 2009-04-05 23:13
Sender: nobody

With the previous code, it's needed to change one more line in the parse
method of he same class:

The next lines:

for (int i = 0; i < childNames.length; i++) {
unparsedElementList.remove(childNames[i]);
parseReps(groupElement, groupObject, messageName, childNames[i],
childNames[i]);
}


Should be changed to:

for (int i = 0; i < childNames.length; i++) {
unparsedElementList.remove(childNames[i]);
if (childNames[i].length()!=4) parseReps(groupElement, groupObject,
messageName, childNames[i], childNames[i]);
}




Date: 2009-04-05 23:06
Sender: polloloco

This can be solved by changing some lines in the parseReps method at
ca.uhn.hl7v2.parser.DefaultXMLParser


if (reps.size() > 1) {
String newIndexName = "";
int i=1;
try{
for (i = 1; i < reps.size(); i++) {
newIndexName=childName+(i+1);
Structure st=groupObject.get(newIndexName);
parseRep((Element) reps.get(i), st);
}
}catch(Throwable t){
log.info("Issue Parsing: "+t);
newIndexName = groupObject.addNonstandardSegment(childName);
for (int j = i; j < reps.size(); j++) {
parseRep((Element) reps.get(j), groupObject.get(newIndexName,
j-i));
}
}
}


Instead of:


if (reps.size() > 1) {
String newIndexName = groupObject.addNonstandardSegment(childName);
for (int i = 1; i < reps.size(); i++) {
parseRep((Element) reps.get(i), groupObject.get(newIndexName, i-1));
}
}





Attached Files ( 2 )

Filename Description Download
adt_a17.xml ADT_A17 XML Download
adt_a17_malformed.er7 ADT_A17 Malformed ER7 Download

Changes ( 7 )

Field Old Value Date By
status_id Open 2009-06-13 17:10 jamesagnew
resolution_id None 2009-06-13 17:10 jamesagnew
allow_comments 1 2009-06-13 17:10 jamesagnew
close_date - 2009-06-13 17:10 jamesagnew
priority 5 2008-10-13 19:00 gerald_bortis
File Added 297219: adt_a17_malformed.er7 2008-10-13 18:59 gerald_bortis
File Added 297218: adt_a17.xml 2008-10-13 18:59 gerald_bortis