001 /* 002 * Created on Dec 11, 2006 003 */ 004 package ca.uhn.hl7v2; 005 006 import ca.uhn.hl7v2.model.Message; 007 import ca.uhn.hl7v2.parser.DefaultXMLParser; 008 import ca.uhn.hl7v2.parser.EncodingNotSupportedException; 009 import ca.uhn.hl7v2.parser.GenericParser; 010 import ca.uhn.hl7v2.parser.Parser; 011 import ca.uhn.hl7v2.view.TreePanel; 012 013 /** 014 * TODO: add! 015 * 016 * @author <a href="mailto:james.agnew@uhn.on.ca">James Agnew</a> 017 * @version $Revision: 1.1 $ updated on $Date: 2007/02/19 02:24:39 $ by $Author: jamesagnew $ 018 */ 019 public class Test 020 { 021 022 023 public static void main(String[] args) throws EncodingNotSupportedException, HL7Exception { 024 025 Parser p = new GenericParser(); 026 String msg = "MSH|^~\\&|LABMI1||DMCRES||19951010134000||ORU^R01|LABMI1199510101340007|D|2.2|||AL|\r\n" + 027 "PID|||BB1127||LABHLVII^MICRO^A||19780625|F||||||||||001680\r\n" + 028 "PV1|||CFLC|||||||MED||||||||P||||||||||||||||||||||||||19950303150000|19950311\r\n" + 029 "OBR|1||09528307086003110|6003110^CULTURE BACTERIA UR INDWELL CA^^^C UR ICATH|||19951010131900|||||||19951010131900|S03593&URINE-INDWELLING CATHETER &&&URI|||||0952830708||1995101013360000||600|P||^^^^^RT||^09528307086003110\r\n" + 030 "OBX||CE|6000417^PRELIMINARY^^^R PRE|0002|I80013^^^^GE100,~I80013^^^^GE100,~I80013^^^^GE100,||||||F|||19951010133600||001\r\n"; 031 Message m = p.parse(msg); 032 033 DefaultXMLParser xp = new DefaultXMLParser(); 034 System.out.println(xp.encode(m)); 035 //TreePanel.showInNewWindow(m); 036 037 } 038 039 }