Package ca.uhn.hl7v2.parser

Examples of ca.uhn.hl7v2.parser.GenericParser


     * Serialize HL7 message to XML
     * @param rowHL7
     * @return XML String
     */
    private String serializeHL7toXML(String rowHL7) {
        Parser xmlParser = new DefaultXMLParser();
        Parser ediParser = new PipeParser();
        ediParser.setValidationContext(new NoValidation());
        String xmlDoc = null;
        try {
            Message message = ediParser.parse(rowHL7);
            ConformanceProfileRule rule = new ConformanceProfileRule();
        ValidationException[] exs = rule.test(message);
        if (exs != null && exs.length > 0) {
          throw new HL7Exception(exs[0].getMessage());
       
            if(log.isDebugEnabled()){
                log.debug("HL7 parsing completed." + message);
            }
            xmlDoc = xmlParser.encode(message);
        } catch (HL7Exception e) {
            handleException("Error on converting to HL7",e);
        }
        return xmlDoc;
    }
View Full Code Here


    private SOAPEnvelope createEnvelope(Message message) throws HL7Exception, XMLStreamException {
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope envelope = fac.getDefaultEnvelope();

        Parser xmlParser = new DefaultXMLParser();
        String xmlDoc = xmlParser.encode(message);

        OMElement hl7Element = AXIOMUtil.stringToOM(xmlDoc);
        OMNamespace ns = fac.createOMNamespace("http://wso2.org/hl7", "hl7");
        OMElement topicOm = fac.createOMElement("message", ns);
        topicOm.addChild(hl7Element);
View Full Code Here

    private SOAPEnvelope createEnvelope(Message message) throws HL7Exception, XMLStreamException {
        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
        SOAPEnvelope envelope = fac.getDefaultEnvelope();

        Parser xmlParser = new DefaultXMLParser();
        String xmlDoc = xmlParser.encode(message);

        OMElement hl7Element = AXIOMUtil.stringToOM(xmlDoc);
        OMNamespace ns = fac.createOMNamespace("http://wso2.org/hl7", "hl7");
        OMElement topicOm = fac.createOMElement("message", ns);
        topicOm.addChild(hl7Element);
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

    /**
     * Creates an instance that uses a <code>GenericParser</code>.
     */
    @Deprecated
    public ApplicationRouterImpl() {
        this(new 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

  private ConnectionHub connectionHub;

  /** Creates a new instance of TestPanel */
  public TestPanel() throws HL7Exception {

    this.parser = new GenericParser();
    // Relax all validation
    this.parser.setValidationContext(new NoValidation());
    connectionHub = ConnectionHub.getInstance();
    router = new MessageTypeRouter();
    initUI();
View Full Code Here

        return xmlParser;
    }

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

  public XMLParser getXMLParser() {
    return new DefaultXMLParser(this);
  }

  public GenericParser getGenericParser() {
    return new GenericParser(this);
  }
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.