Package ca.uhn.hl7v2.parser

Examples of ca.uhn.hl7v2.parser.GenericParser


    /**
     * Creates an instance that uses a <code>GenericParser</code>.
     */
    public ApplicationRouterImpl() {
        init(new GenericParser());
    }
View Full Code Here


     *  with the remote system
     */
    public InitiatorImpl(Processor theProcessor) {
        myMetadataFields = new ArrayList(20);
        myMetadataFields.add("MSH-18"); //add character set by default
        myParser = new GenericParser();
        myProcessor = theProcessor;
        init();
    }
View Full Code Here

{
   
   
    public static void main(String[] args) throws EncodingNotSupportedException, HL7Exception {
       
        Parser p = new GenericParser();
        String msg = "MSH|^~\\&|LABMI1||DMCRES||19951010134000||ORU^R01|LABMI1199510101340007|D|2.2|||AL|\r\n" +
                "PID|||BB1127||LABHLVII^MICRO^A||19780625|F||||||||||001680\r\n" +
                "PV1|||CFLC|||||||MED||||||||P||||||||||||||||||||||||||19950303150000|19950311\r\n" +
                "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" +
                "OBX||CE|6000417^PRELIMINARY^^^R PRE|0002|I80013^^^^GE100,~I80013^^^^GE100,~I80013^^^^GE100,||||||F|||19951010133600||001\r\n";
        Message m = p.parse(msg);
       
        DefaultXMLParser xp = new DefaultXMLParser();
        System.out.println(xp.encode(m));
        //TreePanel.showInNewWindow(m);
       
View Full Code Here

        return xmlParser;
    }

    public synchronized GenericParser getGenericParser() {
        if (genericParser == null) {
            genericParser = new GenericParser(this);
        }
        return genericParser;
    }
View Full Code Here

    }

    DefaultValidator val = new DefaultValidator();
    try {
      String msgString = loadFile(args[0]);
      Parser parser = new GenericParser();
      Message message = parser.parse(msgString);

      String profileString = loadFile(args[1]);
      ProfileParser profParser = new ProfileParser(true);
      RuntimeProfile profile = profParser.parse(profileString);
View Full Code Here

    /**
     * Creates an instance that uses a <code>GenericParser</code>.
     */
  @Deprecated
    public ApplicationRouterImpl() {
        this(new GenericParser());
    }
View Full Code Here

        // Helper class
    }

    @Converter
    public static String toString(Message message) throws HL7Exception {
        Parser parser = new PipeParser();
        String encoded = parser.encode(message);
        return encoded;
    }
View Full Code Here

    @Converter
    public static Message toMessage(String body) throws HL7Exception {
        // replace \n with \r as HL7 uses 0x0d = \r as segment terminators and HAPI only parses with \r
        body = body.replace('\n', '\r');

        Parser parser = new PipeParser();
        Message message = parser.parse(body);
        return message;
    }
View Full Code Here

                                      + "GT1||0222PL|NOTREAL^BOB^B||STREET^OTHER STREET^CITY^ST^77787|(444)999-3333|(222)777-5555||||MO|111-33-5555||||NOTREAL GILL N|STREET^OTHER STREET^CITY^ST^99999|(111)222-3333\r"
                                      + "IN1||022254P|4558PD|BLUE CROSS|STREET^OTHER STREET^CITY^ST^00990||(333)333-6666||221K|LENIX|||19980515|19990515|||PATIENT01 TEST D||||||||||||||||||02LL|022LP554";


    public HL7Message() throws HL7Exception {
        Parser p = new GenericParser();
        adtMessage = p.parse(SAMPLE_MSG);
    }
View Full Code Here

        Parser p = new GenericParser();
        adtMessage = p.parse(SAMPLE_MSG);
    }

    public HL7Message(String msg) throws HL7Exception {
        Parser p = new GenericParser();
        adtMessage = p.parse(msg);
    }
View Full Code Here

TOP

Related Classes of ca.uhn.hl7v2.parser.GenericParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.