Package Parser

Examples of Parser.Parser


        }
        return parser.parse(body);
    }

    static String encode(Message message, boolean validate) throws HL7Exception {
        Parser parser = new PipeParser();
        if (!validate) {
            parser.setValidationContext(new NoValidation());
        }
        return parser.encode(message);
    }
View Full Code Here


    }   

    protected RouteBuilder createRouteBuilder() throws Exception {
        HapiContext hapiContext = new DefaultHapiContext();
        hapiContext.setValidationContext(new NoValidation());
        Parser p = new GenericParser(hapiContext);
        hl7 = new HL7DataFormat();
        hl7.setParser(p);
       
        return new RouteBuilder() {
            public void configure() throws Exception {
View Full Code Here

    }   

    protected RouteBuilder createRouteBuilder() throws Exception {
        HapiContext hapiContext = new DefaultHapiContext();
        hapiContext.setValidationContext(new NoValidation());
        Parser p = new GenericParser(hapiContext);
        hl7 = new HL7DataFormat();
        hl7.setParser(p);
       
        return new RouteBuilder() {
            public void configure() throws Exception {
View Full Code Here

   * @throws EncodingNotSupportedException
   *             If the encoding is not supported
   */
  public IReceivable<Message> sendAndReceiveMessage(ISendable<Message> theMessageToSend) throws DecodeException, IOException, EncodeException, EncodingNotSupportedException, HL7Exception {
    IReceivable<String> response = myRawClient.sendAndReceive(theMessageToSend);
    Parser parser = myParser != null ? myParser : theMessageToSend.getMessage().getParser();
    return new MessageReceivable(parser.parse(response.getMessage()));
  }
View Full Code Here

        }

        // convert to string
        String body;
        if (message instanceof Message) {
            Parser parser = new PipeParser();
            body = parser.encode((Message)message);
        } else if (message instanceof String) {
            body = (String)message;
        } else if (message instanceof byte[]) {
            body = new String((byte[])message);
        } else {
View Full Code Here

    /**
     * {@inheritDoc }
     */
    @Override
    public String encode() throws HL7Exception {
        Parser p = getMessage().getParser();
        return p.doEncode(this, EncodingCharacters.getInstance(getMessage()));
    }
View Full Code Here

        assertMockEndpointsSatisfied();
    }   

    protected RouteBuilder createRouteBuilder() throws Exception {
        Parser p = new PipeParser();
        p.setValidationContext(new NoValidation());
        hl7 = new HL7DataFormat();
        hl7.setParser(p);
       
        return new RouteBuilder() {
            public void configure() throws Exception {
View Full Code Here

        Message received = mock.getReceivedExchanges().get(0).getIn().getMandatoryBody(Message.class);
        assertEquals("O01", new Terser(received).get("MSH-9-2"));
    }   

    protected RouteBuilder createRouteBuilder() throws Exception {
        Parser p = new GenericParser();
        p.setValidationContext(new NoValidation());
        hl7 = new HL7DataFormat();
        hl7.setParser(p);
       
        return new RouteBuilder() {
            public void configure() throws Exception {
View Full Code Here

        /*
         * In a real situation, of course, many more segments and fields would be populated
         */
               
        // Now, let's encode the message and look at the output
        Parser parser = new PipeParser();
        String encodedMessage = parser.encode(adt);
        System.out.println("Printing ER7 Encoded Message:");
        System.out.println(encodedMessage);
       
        /*
         * Prints:
         *
         * MSH|^~\&|TestSendingSystem||||200701011539||ADT^A01^ADT A01||||123
         * PID|||123456||Doe^John
         */

        // Next, let's use the XML parser to encode as XML
        parser = new DefaultXMLParser();
        encodedMessage = parser.encode(adt);
        System.out.println("Printing XML Encoded Message:");
        System.out.println(encodedMessage);
       
        /*
         * Prints:
 
View Full Code Here

                + "PV1|0001|I|D.ER^1F^M950^01|ER|P000998|11B^M011^02|070615^BATMAN^GEORGE^L|555888^OKNEL^BOB^K^DR^MD|777889^NOTREAL^SAM^T^DR^MD^PHD|ER|D.WT^1A^M010^01|||ER|AMB|02|070615^VOICE^BILL^L|ER|000001916994|D||||||||||||||||GDD|WA|NORM|02|O|02|E.IN^02D^M090^01|E.IN^01D^M080^01|199904072124|199904101200|||||5555112333|||666097^DNOTREAL^MANNY^P\r"
                + "PV2|||0112^TESTING|55555^PATIENT IS NORMAL|NONE|||19990225|19990226|1|1|TESTING|555888^NOTREAL^BOB^K^DR^MD||||||||||PROD^003^099|02|ER||NONE|19990225|19990223|19990316|NONE\r"
                + "AL1||SEV|001^POLLEN\r"
                + "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";
        Parser p = new GenericParser();
        Message adt = p.parse(msg);

        // The connection hub connects to listening servers
        ConnectionHub connectionHub = ConnectionHub.getInstance();

        // A connection object represents a socket attached to an HL7 server
View Full Code Here

TOP

Related Classes of Parser.Parser

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.