congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Message
Code IndexAdd Tabnine to your IDE (free)

How to use
Message
in
ca.uhn.hl7v2.model

Best Java code snippets using ca.uhn.hl7v2.model.Message (Showing top 20 results out of 315)

origin: pentaho/pentaho-kettle

parser.setValidationContext( validationContext );
Message msg = parser.parse( message );
Structure structure = msg.get( "MSH" );
String messageType = null;
String version = msg.getVersion();
origin: org.openehealth.ipf.commons/ipf-commons-ihe-hl7v2

/**
 * Generates an HL7v2 NAK response message on the basis
 * of the thrown exception and the original HAPI request message.
 *
 * @param exception       thrown exception.
 * @param originalMessage original HAPI request message.
 * @param ackTypeCode     HL7v2 acknowledgement type code.
 */
public Message createNak(Message originalMessage, HL7Exception exception, AcknowledgmentCode ackTypeCode) throws HL7Exception, IOException {
  return originalMessage.generateACK(ackTypeCode, exception);
}
origin: pentaho/pentaho-kettle

parser.setValidationContext( validationContext );
Message msg = parser.parse( message );
Message ack = msg.generateACK();
String ackMessage = ack.encode();
origin: pentaho/pentaho-kettle

  new HL7Value( message.getVersion(), rootGroup.getName(), group.getName(), structure.getName(),
    structureNumber, names[n - 1], coordinates, types[t].getName(), description, string );
values.add( value );
origin: ca.uhn.hapi/hapi-base

/**
 * @deprecated use {@link Message#generateACK()}
 */
public static Message makeACK(Segment inboundHeader) throws HL7Exception,
    IOException {
  // Make sure that the referenced message is not just a dummy
  DeepCopy.copy(inboundHeader, (Segment)inboundHeader.getMessage().get("MSH"));
  return inboundHeader.getMessage().generateACK();
}
origin: ca.uhn.hapi/hapi-base

private String handleProcessMessageException(String incomingMessageString, Map<String, Object> theMetadata, Message incomingMessageObject, Exception e) throws HL7Exception {
  String outgoingMessageString;
  Segment inHeader = incomingMessageObject != null ? (Segment) incomingMessageObject.get("MSH") : null;
  outgoingMessageString = logAndMakeErrorMessage(e, inHeader, myParser, myParser.getEncoding(incomingMessageString));
  if (outgoingMessageString != null && myExceptionHandler != null) {
    outgoingMessageString = myExceptionHandler.processException(incomingMessageString, theMetadata, outgoingMessageString, e);
  }
  return outgoingMessageString;
}
origin: ca.uhn.hapi/hapi-base

public Parser getParser() {
  return getDelegate().getParser();
}
origin: openmrs/openmrs-core

/**
 * Always returns true, assuming that the router calling this handler will only call this
 * handler with ADT_A28 messages.
 *
 * @return true
 */
@Override
public boolean canProcess(Message message) {
  return message != null && "ADT_A28".equals(message.getName());
}

origin: ca.uhn.hapi/hapi-base

/**
 * Returns an instance using the MSH-1 and MSH-2 values of the given message
 *
 * @param message the message
 * @return the encoding characters for this message
 * @throws HL7Exception If either MSH-1 or MSH-2 are not populated
 * @since 1.0
 */
public static EncodingCharacters getInstance(Message message) throws HL7Exception {
  final String encodingCharactersValue = message.getEncodingCharactersValue();
  if (encodingCharactersValue == null || encodingCharactersValue.length() == 0) {
    throw new HL7Exception("encoding characters not populated");
  }
  final Character fieldSeparatorValue = message.getFieldSeparatorValue();
  if (fieldSeparatorValue == null) {
    throw new HL7Exception("Field separator not populated");
  }
  return new EncodingCharacters(fieldSeparatorValue, encodingCharactersValue);
}
origin: ca.uhn.hapi/hapi-osgi-base

private Message instantiateACK() throws HL7Exception {
  ModelClassFactory mcf = getParser() != null ? 
      getParser().getFactory() : 
      new DefaultModelClassFactory();
  Version version = Version.versionOf(getVersion());
  Message out = null;
  if (version != null && version.available()) {
    Class<? extends Message> clazz = mcf.getMessageClass("ACK", version.getVersion(), false);
    if (clazz != null) {
      out = ReflectionUtil.instantiateMessage(clazz, mcf);
    }
  }
  if (out == null) {
    out = new GenericMessage.UnknownVersion(mcf);
  }
  
  if (out instanceof GenericMessage) {
    if (!ArrayUtil.contains(out.getNames(), "MSA")) {
      out.addNonstandardSegment("MSA");
    }
    if (!ArrayUtil.contains(out.getNames(), "ERR")) {
      out.addNonstandardSegment("ERR");
    }
  }
  
  return out;
}
origin: ca.uhn.hapi/hapi-osgi-base

public String encode() throws HL7Exception {
  return originalMessage != null ? originalMessage : getDelegate().encode();
}
origin: ca.uhn.hapi/hapi-base

public Character getFieldSeparatorValue() throws HL7Exception {
  return getDelegate().getFieldSeparatorValue();
}
origin: ca.uhn.hapi/hapi-base

public String getEncodingCharactersValue() throws HL7Exception {
  return getDelegate().getEncodingCharactersValue();
}
origin: openmrs/openmrs-core

private void validate(Message message) throws HL7Exception {
  message.getVersion();
}

origin: ca.uhn.hapi/hapi-osgi-base

/**
 * @deprecated use {@link Message#generateACK()}
 */
public static Message makeACK(Segment inboundHeader) throws HL7Exception,
    IOException {
  // Make sure that the referenced message is not just a dummy
  DeepCopy.copy(inboundHeader, (Segment)inboundHeader.getMessage().get("MSH"));
  return inboundHeader.getMessage().generateACK();
}
origin: ca.uhn.hapi/hapi-osgi-base

private String handleProcessMessageException(String incomingMessageString, Map<String, Object> theMetadata, Message incomingMessageObject, Exception e) throws HL7Exception {
  String outgoingMessageString;
  Segment inHeader = incomingMessageObject != null ? (Segment) incomingMessageObject.get("MSH") : null;
  outgoingMessageString = logAndMakeErrorMessage(e, inHeader, myParser, myParser.getEncoding(incomingMessageString));
  if (outgoingMessageString != null && myExceptionHandler != null) {
    outgoingMessageString = myExceptionHandler.processException(incomingMessageString, theMetadata, outgoingMessageString, e);
  }
  return outgoingMessageString;
}
origin: ca.uhn.hapi/hapi-osgi-base

public Parser getParser() {
  return getDelegate().getParser();
}
origin: openmrs/openmrs-core

/**
 * Always returns true, assuming that the router calling this handler will only call this
 * handler with ORU_R01 messages.
 *
 * @return true
 */
@Override
public boolean canProcess(Message message) {
  return message != null && "ORU_R01".equals(message.getName());
}

origin: ca.uhn.hapi/hapi-osgi-base

/**
 * Returns an instance using the MSH-1 and MSH-2 values of the given message
 *
 * @param message the message
 * @return the encoding characters for this message
 * @throws HL7Exception If either MSH-1 or MSH-2 are not populated
 * @since 1.0
 */
public static EncodingCharacters getInstance(Message message) throws HL7Exception {
  final String encodingCharactersValue = message.getEncodingCharactersValue();
  if (encodingCharactersValue == null || encodingCharactersValue.length() == 0) {
    throw new HL7Exception("encoding characters not populated");
  }
  final Character fieldSeparatorValue = message.getFieldSeparatorValue();
  if (fieldSeparatorValue == null) {
    throw new HL7Exception("Field separator not populated");
  }
  return new EncodingCharacters(fieldSeparatorValue, encodingCharactersValue);
}
origin: ca.uhn.hapi/hapi-base

private Message instantiateACK() throws HL7Exception {
  ModelClassFactory mcf = getParser() != null ? 
      getParser().getFactory() : 
      new DefaultModelClassFactory();
  Version version = Version.versionOf(getVersion());
  Message out = null;
  if (version != null && version.available()) {
    Class<? extends Message> clazz = mcf.getMessageClass("ACK", version.getVersion(), false);
    if (clazz != null) {
      out = ReflectionUtil.instantiateMessage(clazz, mcf);
    }
  }
  if (out == null) {
    out = new GenericMessage.UnknownVersion(mcf);
  }
  
  if (out instanceof GenericMessage) {
    if (!ArrayUtil.contains(out.getNames(), "MSA")) {
      out.addNonstandardSegment("MSA");
    }
    if (!ArrayUtil.contains(out.getNames(), "ERR")) {
      out.addNonstandardSegment("ERR");
    }
  }
  
  return out;
}
ca.uhn.hl7v2.modelMessage

Javadoc

Represents a complete HL7 message including all structures, segments, and fields.

Note this it is not recommended to implement this interface directly, as it is subject to change. Instead, extend abstract implementations for your model classes, such as AbstractMessageand AbstractGroup

Most used methods

  • get
  • getVersion
    Returns the version number of the HL7 version in which this message structure is defined (e.g. "2.4"
  • generateACK
    Generates and returns an ACK message which would be used to acknowledge this message successfully.
  • encode
    Encodes this message using the parser returned by #getParser()
  • getName
  • getParser
    Returns the parser to be used when parse/encode methods are called on this Message, as well as its c
  • addNonstandardSegment
  • getEncodingCharactersValue
    Convenience method which retrieves the encoding characters value from the second field of the first
  • getFieldSeparatorValue
    Convenience method which retrieves the field separator value from the first field of the first segme
  • getNames
  • parse
    Parses the string into this message using the parser returned by #getParser()
  • printStructure
    Prints a summary of the contents and structure of this message. This is useful for debugging purpos
  • parse,
  • printStructure,
  • setParser

Popular in Java

  • Creating JSON documents from java classes using gson
  • getApplicationContext (Context)
  • onCreateOptionsMenu (Activity)
  • startActivity (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Menu (java.awt)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Join (org.hibernate.mapping)
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now