+ "ZPI|Fido~Fred|13\r"
+ "PV1||I|6402DH^^^^^^^^MED. 1 - ONCOLOGIA^^OSPEDALE MAGGIORE DI LODI&LODI|||^^^^^^^^^^OSPEDALE MAGGIORE DI LODI&LODI|13936^TEST^TEST||||||||||5068^TEST2^TEST2||2008003369||||||||||||||||||||||||||200803031508\r"
+ "PR1|1||1111^Mastoplastica|Protesi|20090224|02|";
// HAPI will still parse this message fine
ADT_A01 message = (ADT_A01) new PipeParser().parse(messageText);
// If we want to access the data in the ZPI segment, it's pretty easy
Segment zpiGenericSegment = (Segment) message.get("ZPI");
String firstPetName = zpiGenericSegment.getField(1, 0).encode();
String secondPetName = zpiGenericSegment.getField(1, 1).encode();
System.out.println(firstPetName); // Fido
System.out.println(secondPetName); // Fred