Tabnine Logo
EncodingCharacters.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
ca.uhn.hl7v2.parser.EncodingCharacters
constructor

Best Java code snippets using ca.uhn.hl7v2.parser.EncodingCharacters.<init> (Showing top 20 results out of 315)

origin: ca.uhn.hapi/hapi-base

/**
 * Returns an instance of encoding characters with the standard ER7 encoding characters
 * defined: |^~\&
 *
 * @return a default instance of encoding characters
 */
public static EncodingCharacters defaultInstance() {
  return new EncodingCharacters('|', null);
}

origin: ca.uhn.hapi/hapi-base

public DefaultValidator(HapiContext context) {
  super(context);
  enc = new EncodingCharacters('|', null); // the | is assumed later -- don't change
}    
origin: org.openehealth.ipf.gazelle/ipf-gazelle-validation-commons-core

public GazelleProfileRule(HL7V2XConformanceProfile profile) {
  enc = new EncodingCharacters('|', null); // the | is assumed later -- don't change
  this.profile = profile;
}
origin: ca.uhn.hapi/hapi-osgi-base

/**
 * Returns an instance of encoding characters with the standard ER7 encoding characters
 * defined: |^~\&
 *
 * @return a default instance of encoding characters
 */
public static EncodingCharacters defaultInstance() {
  return new EncodingCharacters('|', null);
}

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

public DefaultValidator(HapiContext context) {
  super(context);
  enc = new EncodingCharacters('|', null); // the | is assumed later -- don't change
}    
origin: openmrs/openmrs-core

throw new HL7Exception(Context.getMessageSourceService().getMessage(
  "ORUR01.error.improperlyFormattedOBX",
  new Object[] { PipeParser.encode(obx, new EncodingCharacters('|', "^~\\&")) }, null),
    HL7Exception.DATA_TYPE_ERROR, errorInHL7Queue);
origin: ca.uhn.hapi/hapi-osgi-base

public Object clone() throws CloneNotSupportedException
{
  super.clone();
  return new EncodingCharacters(this);
}

origin: ca.uhn.hapi/hapi-base

public Object clone() throws CloneNotSupportedException
{
  super.clone();
  return new EncodingCharacters(this);
}

origin: ca.uhn.hapi/hapi-base

/**
 * Returns object that contains the field separator and encoding characters
 * for this message.
 */
private static EncodingCharacters getEncodingChars(String message) {
  return new EncodingCharacters(message.charAt(3), message.substring(4, 8));
}

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

/**
 * Returns object that contains the field separator and encoding characters
 * for this message.
 */
private static EncodingCharacters getEncodingChars(String message) {
  return new EncodingCharacters(message.charAt(3), message.substring(4, 8));
}

origin: ca.uhn.hapi/hapi-base

/**
 * Returns object that contains the field separator and encoding characters
 * for this message.
 *
 * There's an additional character starting with v2.7 (truncation), but we will
 * accept it in messages of any version.
 * 
 * @throws HL7Exception
 */
private static EncodingCharacters getEncodingChars(String message) throws HL7Exception {
  if (message.length() < 9) {
    throw new HL7Exception("Invalid message content: \"" + message + "\"");
  }
  return new EncodingCharacters(message.charAt(3), message.substring(4, 9));
}
origin: ca.uhn.hapi/hapi-osgi-base

/**
 * Returns object that contains the field separator and encoding characters
 * for this message.
 *
 * There's an additional character starting with v2.7 (truncation), but we will
 * accept it in messages of any version.
 * 
 * @throws HL7Exception
 */
private static EncodingCharacters getEncodingChars(String message) throws HL7Exception {
  if (message.length() < 9) {
    throw new HL7Exception("Invalid message content: \"" + message + "\"");
  }
  return new EncodingCharacters(message.charAt(3), message.substring(4, 9));
}
origin: ca.uhn.hapi/hapi-base

/** Parses message and dumps contents to props, with keys in the 
ZYX[a]-b[c]-d-e style.
*/
public static boolean parseMessage(/*out*/ Properties props, 
  /*in*/ List<DatumPath> msgMask, /*in*/ String message)
{
  boolean ok = false;
  if(message != null) {
    if(props == null)
      props = new Properties();
    StringTokenizer messageTokenizer 
      = new StringTokenizer(message, segmentSeparators);
    if(messageTokenizer.hasMoreTokens()) {
      String firstSegment = messageTokenizer.nextToken();
      EncodingCharacters encodingChars = new EncodingCharacters('0', "0000");
      if(parseMSHSegmentWhole(props, msgMask, encodingChars, firstSegment)) {
        ok = true;
        SortedMap<String, Integer> segmentId2nextRepIdx = new TreeMap<String, Integer>();
        segmentId2nextRepIdx.put(new String("MSH"), 1); 
          // in case we find another MSH segment, heh.
        while(messageTokenizer.hasMoreTokens()) {
          parseSegmentWhole(props, segmentId2nextRepIdx, 
            msgMask, encodingChars, messageTokenizer.nextToken());
        }
      }
    }
  }
  return ok;
}

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

/** Parses message and dumps contents to props, with keys in the 
ZYX[a]-b[c]-d-e style.
*/
public static boolean parseMessage(/*out*/ Properties props, 
  /*in*/ List<DatumPath> msgMask, /*in*/ String message)
{
  boolean ok = false;
  if(message != null) {
    if(props == null)
      props = new Properties();
    StringTokenizer messageTokenizer 
      = new StringTokenizer(message, segmentSeparators);
    if(messageTokenizer.hasMoreTokens()) {
      String firstSegment = messageTokenizer.nextToken();
      EncodingCharacters encodingChars = new EncodingCharacters('0', "0000");
      if(parseMSHSegmentWhole(props, msgMask, encodingChars, firstSegment)) {
        ok = true;
        SortedMap<String, Integer> segmentId2nextRepIdx = new TreeMap<String, Integer>();
        segmentId2nextRepIdx.put(new String("MSH"), 1); 
          // in case we find another MSH segment, heh.
        while(messageTokenizer.hasMoreTokens()) {
          parseSegmentWhole(props, segmentId2nextRepIdx, 
            msgMask, encodingChars, messageTokenizer.nextToken());
        }
      }
    }
  }
  return ok;
}

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

private EncodingCharacters getValidEncodingCharacters(char fieldSep, Segment msh) throws HL7Exception {
  String encCharString = Terser.get(msh, 2, 0, 1, 1);
  if (encCharString == null) {
    throw new HL7Exception("Can't encode message: MSH-2 (encoding characters) is missing");
  }
  if (Version.V27.isGreaterThan(Version.versionOf(msh.getMessage().getVersion())) && encCharString.length() != 4) {
    throw new HL7Exception("Encoding characters (MSH-2) value '" + encCharString + "' invalid -- must be 4 characters", ErrorCode.DATA_TYPE_ERROR);
  } else if (encCharString.length() != 4 && encCharString.length() != 5) {
    throw new HL7Exception("Encoding characters (MSH-2) value '" + encCharString + "' invalid -- must be 4 or 5 characters", ErrorCode.DATA_TYPE_ERROR);
  }
  return new EncodingCharacters(fieldSep, encCharString);
}
origin: ca.uhn.hapi/hapi-base

private EncodingCharacters getValidEncodingCharacters(char fieldSep, Segment msh) throws HL7Exception {
  String encCharString = Terser.get(msh, 2, 0, 1, 1);
  if (encCharString == null) {
    throw new HL7Exception("Can't encode message: MSH-2 (encoding characters) is missing");
  }
  if (Version.V27.isGreaterThan(Version.versionOf(msh.getMessage().getVersion())) && encCharString.length() != 4) {
    throw new HL7Exception("Encoding characters (MSH-2) value '" + encCharString + "' invalid -- must be 4 characters", ErrorCode.DATA_TYPE_ERROR);
  } else if (encCharString.length() != 4 && encCharString.length() != 5) {
    throw new HL7Exception("Encoding characters (MSH-2) value '" + encCharString + "' invalid -- must be 4 or 5 characters", ErrorCode.DATA_TYPE_ERROR);
  }
  return new EncodingCharacters(fieldSep, encCharString);
}
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

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

  "Encoding characters '" + encCharString + "' invalid -- must be 4 characters",
  ErrorCode.DATA_TYPE_ERROR);
EncodingCharacters en = new EncodingCharacters(fieldSep, encCharString);
origin: ca.uhn.hapi/hapi-base

  "Encoding characters '" + encCharString + "' invalid -- must be 4 characters",
  ErrorCode.DATA_TYPE_ERROR);
EncodingCharacters en = new EncodingCharacters(fieldSep, encCharString);
ca.uhn.hl7v2.parserEncodingCharacters<init>

Javadoc

Creates new EncodingCharacters object with the given character values. If the encodingCharacters argument is null, the default values are used.

Popular methods of EncodingCharacters

  • defaultInstance
    Returns an instance of encoding characters with the standard ER7 encoding characters defined: |^~\&
  • getComponentSeparator
    Returns the component separator.
  • getEscapeCharacter
    Returns the escape character.
  • getFieldSeparator
    Returns the field separator.
  • getInstance
    Returns an instance using the MSH-1 and MSH-2 values of the given message
  • getRepetitionSeparator
    Returns the repetition separator.
  • getSubcomponentSeparator
    Returns the subcomponent separator.
  • getTruncationCharacter
    Returns the truncation character.
  • setComponentSeparator
  • setEscapeCharacter
  • setFieldSeparator
  • setRepetitionSeparator
  • setFieldSeparator,
  • setRepetitionSeparator,
  • setSubcomponentSeparator,
  • setTruncationCharacter,
  • toString

Popular in Java

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • getSystemService (Context)
  • setScale (BigDecimal)
  • Menu (java.awt)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • JLabel (javax.swing)
  • JPanel (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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