java.lang.Object
org.wso2.carbon.inbound.endpoint.protocol.hl7.util.HL7MessageUtils

public class HL7MessageUtils extends Object
  • Constructor Details

    • HL7MessageUtils

      public HL7MessageUtils()
  • Method Details

    • parse

      public static ca.uhn.hl7v2.model.Message parse(String msg, boolean validate) throws ca.uhn.hl7v2.HL7Exception
      Throws:
      ca.uhn.hl7v2.HL7Exception
    • parse

      public static ca.uhn.hl7v2.model.Message parse(String msg, ca.uhn.hl7v2.parser.Parser preProcessor) throws ca.uhn.hl7v2.HL7Exception
      Throws:
      ca.uhn.hl7v2.HL7Exception
    • createSynapseMessageContext

      public static org.apache.synapse.MessageContext createSynapseMessageContext(ca.uhn.hl7v2.model.Message message, org.apache.synapse.inbound.InboundProcessorParams params) throws ca.uhn.hl7v2.HL7Exception, org.apache.axis2.AxisFault
      Throws:
      ca.uhn.hl7v2.HL7Exception
      org.apache.axis2.AxisFault
    • createErrorMessageContext

      public static org.apache.synapse.MessageContext createErrorMessageContext(String rawMessage, Exception errorMsg, org.apache.synapse.inbound.InboundProcessorParams params) throws org.apache.axis2.AxisFault, ca.uhn.hl7v2.HL7Exception
      Throws:
      org.apache.axis2.AxisFault
      ca.uhn.hl7v2.HL7Exception
    • generateHL7MessageElement

      public static org.apache.axiom.om.OMElement generateHL7MessageElement(String hl7XmlMessage) throws XMLStreamException
      Throws:
      XMLStreamException
    • generateHL7RawMessaegElement

      public static org.apache.axiom.om.OMElement generateHL7RawMessaegElement(String hl7XmlMessage)
    • createNack

      public static ca.uhn.hl7v2.model.Message createNack(ca.uhn.hl7v2.model.Message hl7Msg, String errorMsg) throws ca.uhn.hl7v2.HL7Exception
      Throws:
      ca.uhn.hl7v2.HL7Exception
    • createDefaultNack

      public static ca.uhn.hl7v2.model.Message createDefaultNack(String errorMsg)
    • getInt

      public static int getInt(String key, org.apache.synapse.inbound.InboundProcessorParams params) throws NumberFormatException
      Throws:
      NumberFormatException
    • getBoolean

      public static boolean getBoolean(String key, org.apache.synapse.inbound.InboundProcessorParams params)
    • payloadToHL7Message

      public static ca.uhn.hl7v2.model.Message payloadToHL7Message(org.apache.synapse.MessageContext ctx, org.apache.synapse.inbound.InboundProcessorParams params) throws ca.uhn.hl7v2.HL7Exception, NoSuchElementException
      Get the hl7message from the MessageContext
      Parameters:
      ctx -
      Returns:
      Throws:
      ca.uhn.hl7v2.HL7Exception
      NoSuchElementException