Package ca.uhn.hl7v2.model.v22.segment

Examples of ca.uhn.hl7v2.model.v22.segment.OM1


        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


     * 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());
       
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

        // 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

        }

        // 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

    private HL7Converter() {
        // Helper class
    }

    private static Parser getParser() {
        PipeParser pipeParser = new PipeParser();
        pipeParser.setValidationContext(new NoValidation());
        return pipeParser;
    }
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

TOP

Related Classes of ca.uhn.hl7v2.model.v22.segment.OM1

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.