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

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

Best Java code snippets using ca.uhn.hl7v2.parser.EncodingCharacters (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: apache/nifi

public HapiField(final Type type) {
  this.value = PipeParser.encode(type, EncodingCharacters.defaultInstance());
  final List<HL7Component> componentList = new ArrayList<>();
  if (type instanceof Composite) {
    final Composite composite = (Composite) type;
    for (final Type component : composite.getComponents()) {
      componentList.add(new HapiField(component));
    }
  }
  final ExtraComponents extra = type.getExtraComponents();
  if (extra != null && extra.numComponents() > 0) {
    final String singleFieldValue;
    if (type instanceof Primitive) {
      singleFieldValue = ((Primitive) type).getValue();
    } else {
      singleFieldValue = this.value;
    }
    componentList.add(new SingleValueField(singleFieldValue));
    for (int i = 0; i < extra.numComponents(); i++) {
      componentList.add(new HapiField(extra.getComponent(i)));
    }
  }
  this.components = Collections.unmodifiableList(componentList);
}
origin: ca.uhn.hapi/hapi-osgi-base

/** @see java.lang.Object#hashCode */
public int hashCode() {
  return 7 * (int) this.getComponentSeparator()
    * (int) this.getEscapeCharacter()
    * (int) this.getFieldSeparator()
    * (int) this.getRepetitionSeparator()
    * (int) this.getSubcomponentSeparator()
    * (int) this.getTruncationCharacter();
}  
origin: ca.uhn.hapi/hapi-base

/** copies contents of "other" */

public EncodingCharacters(EncodingCharacters other) {
  this.fieldSep = other.getFieldSeparator();
  this.encChars = new char[5];
  setComponentSeparator(other.getComponentSeparator());
  setRepetitionSeparator(other.getRepetitionSeparator());
  setEscapeCharacter(other.getEscapeCharacter());
  setSubcomponentSeparator(other.getSubcomponentSeparator());
  setTruncationCharacter(other.getTruncationCharacter());
}

origin: ca.uhn.hapi/hapi-base

encodingChars.setFieldSeparator(segment.charAt(3));
List<Integer> nodeKey = new ArrayList<Integer>();
nodeKey.add(new Integer(0));
handler.putDatum(nodeKey, String.valueOf(encodingChars.getFieldSeparator()));
encodingChars.setComponentSeparator(segment.charAt(4));
encodingChars.setRepetitionSeparator(segment.charAt(5));
encodingChars.setEscapeCharacter(segment.charAt(6));
encodingChars.setSubcomponentSeparator(segment.charAt(7));
nodeKey.set(0, new Integer(1));
handler.putDatum(nodeKey, encodingChars.toString());
if(segment.charAt(8) == encodingChars.getFieldSeparator()) {	
  ret = true; 
origin: ca.uhn.hapi/hapi-base

/**
 * Encodes the given Type, using the given encoding characters. 
 * It is assumed that the Type represents a complete field rather than a component.
 */
public static String encode(Type source, EncodingCharacters encodingChars) {
  StringBuffer field = new StringBuffer();
  for (int i = 1; i <= Terser.numComponents(source); i++) {
    StringBuffer comp = new StringBuffer();
    for (int j = 1; j <= Terser.numSubComponents(source, i); j++) {
      Primitive p = Terser.getPrimitive(source, i, j);
      comp.append(encodePrimitive(p, encodingChars));
      comp.append(encodingChars.getSubcomponentSeparator());
    }
    field.append(stripExtraDelimiters(comp.toString(), encodingChars.getSubcomponentSeparator()));
    field.append(encodingChars.getComponentSeparator());
  }
  return stripExtraDelimiters(field.toString(), encodingChars.getComponentSeparator());
  //return encode(source, encodingChars, false);
}

origin: ca.uhn.hapi/hapi-base

  setComponentSeparator('^');            
  setRepetitionSeparator('~');            
  setEscapeCharacter('\\');
  setSubcomponentSeparator('&');
  setTruncationCharacter('#');
} else {
  encodingCharacters.getChars(0, 4, this.encChars, 0);
    char extraChar = encodingCharacters.charAt(4);
    if (extraChar != fieldSeparator) {
      setTruncationCharacter(extraChar);
origin: ca.uhn.hapi/hapi-base

public static String encode(Segment source, EncodingCharacters encodingChars) {
  StringBuffer result = new StringBuffer();
  result.append(source.getName());
  result.append(encodingChars.getFieldSeparator());
        result.append(fieldText);
        if (j < reps.length - 1)
          result.append(encodingChars.getRepetitionSeparator());
      log.error("Error while encoding segment: ", e);
    result.append(encodingChars.getFieldSeparator());
  return stripExtraDelimiters(result.toString(), encodingChars.getFieldSeparator());
origin: ca.uhn.hapi/hapi-base

try {
  String[] fields = split(message.substring(0, Math.max(message.indexOf(segDelim), message.length())),
    String.valueOf(ec.getFieldSeparator()));
  wholeFieldNine = fields[8];
  String[] comps = split(wholeFieldNine, String.valueOf(ec.getComponentSeparator()));
  if (comps.length >= 3) {
    messageStructure = comps[2];
origin: ca.uhn.hapi/hapi-osgi-base

EncodingCharacters encodingCharacters = EncodingCharacters.getInstance(getMessage());
char subc = encodingCharacters.getSubcomponentSeparator();
char cmpc = encodingCharacters.getComponentSeparator();
origin: ca.uhn.hapi/hapi-base

/**
 * {@inheritDoc }
 */
public String encode() throws HL7Exception {
  return getMessage().getParser().doEncode(this, EncodingCharacters.getInstance(getMessage()));
}
origin: ca.uhn.hapi/hapi-base

  && ESCAPE_NODENAME.equals(child.getLocalName())) {
assertNamespaceURI(child.getNamespaceURI());
EncodingCharacters ec = EncodingCharacters.getInstance(datatypeObject
    .getMessage());
Element elem = (Element) child;
String attr = elem.getAttribute(ESCAPE_ATTRNAME).trim();
if (attr.length() > 0) {
  builder.append(ec.getEscapeCharacter()).append(attr)
      .append(ec.getEscapeCharacter());
origin: ca.uhn.hapi/hapi-base

for (Type stype : subComponentsInFirstField) {
  if (firstComponentValue.length() != 0) {
    char subComponentSeparator = EncodingCharacters.getInstance(segment.getMessage()).getSubcomponentSeparator();
    firstComponentValue.append(subComponentSeparator);
origin: org.openehealth.ipf.gazelle/ipf-gazelle-validation-commons-core

/**
 * Tests for extra components (i.e. any not defined in the profile)
 */
protected List<ValidationException> checkUndefinedComponents(Composite comp, int numInProfile) {
  List<ValidationException> exList = new ArrayList<>();
  StringBuilder extra = new StringBuilder();
  for (int i = numInProfile; i < comp.getComponents().length; i++) {
    try {
      String s = comp.getComponent(i).encode();
      if (s.length() > 0) {
        extra.append(s).append(enc.getComponentSeparator());
      }
    } catch (HL7Exception de) {
      exList.add(new ValidationException(de));
    }
  }
  profileViolatedWhen(extra.toString().length() > 0, exList, COMPONENT_NOT_DEFINED_IN_PROFILE, extra.toString());
  return exList;
}
origin: ca.uhn.hapi/hapi-base

  parseThisSegment = maskIt.next().startsWith(segmentIdAsDatumPath);
if(parseThisSegment && (segment.charAt(3) == encodingChars.getFieldSeparator())) {
  ER7SegmentHandler handler = new ER7SegmentHandler();
  handler.m_props = props;
origin: ca.uhn.hapi/hapi-osgi-base

char escapeChar = encChars.getEscapeCharacter();
boolean foundEscapeChar = false;
for (int i = 0; i < text.length(); i++) {
origin: ca.uhn.hapi/hapi-osgi-base

/** copies contents of "other" */

public EncodingCharacters(EncodingCharacters other) {
  this.fieldSep = other.getFieldSeparator();
  this.encChars = new char[5];
  setComponentSeparator(other.getComponentSeparator());
  setRepetitionSeparator(other.getRepetitionSeparator());
  setEscapeCharacter(other.getEscapeCharacter());
  setSubcomponentSeparator(other.getSubcomponentSeparator());
  setTruncationCharacter(other.getTruncationCharacter());
}

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

encodingChars.setFieldSeparator(segment.charAt(3));
List<Integer> nodeKey = new ArrayList<Integer>();
nodeKey.add(new Integer(0));
handler.putDatum(nodeKey, String.valueOf(encodingChars.getFieldSeparator()));
encodingChars.setComponentSeparator(segment.charAt(4));
encodingChars.setRepetitionSeparator(segment.charAt(5));
encodingChars.setEscapeCharacter(segment.charAt(6));
encodingChars.setSubcomponentSeparator(segment.charAt(7));
nodeKey.set(0, new Integer(1));
handler.putDatum(nodeKey, encodingChars.toString());
if(segment.charAt(8) == encodingChars.getFieldSeparator()) {	
  ret = true; 
origin: ca.uhn.hapi/hapi-osgi-base

/**
 * Encodes the given Type, using the given encoding characters. 
 * It is assumed that the Type represents a complete field rather than a component.
 */
public static String encode(Type source, EncodingCharacters encodingChars) {
  StringBuffer field = new StringBuffer();
  for (int i = 1; i <= Terser.numComponents(source); i++) {
    StringBuffer comp = new StringBuffer();
    for (int j = 1; j <= Terser.numSubComponents(source, i); j++) {
      Primitive p = Terser.getPrimitive(source, i, j);
      comp.append(encodePrimitive(p, encodingChars));
      comp.append(encodingChars.getSubcomponentSeparator());
    }
    field.append(stripExtraDelimiters(comp.toString(), encodingChars.getSubcomponentSeparator()));
    field.append(encodingChars.getComponentSeparator());
  }
  return stripExtraDelimiters(field.toString(), encodingChars.getComponentSeparator());
  //return encode(source, encodingChars, false);
}

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

  setComponentSeparator('^');            
  setRepetitionSeparator('~');            
  setEscapeCharacter('\\');
  setSubcomponentSeparator('&');
  setTruncationCharacter('#');
} else {
  encodingCharacters.getChars(0, 4, this.encChars, 0);
    char extraChar = encodingCharacters.charAt(4);
    if (extraChar != fieldSeparator) {
      setTruncationCharacter(extraChar);
ca.uhn.hl7v2.parserEncodingCharacters

Javadoc

Represents the set of special characters used to encode traditionally encoded HL7 messages.

Most used methods

  • <init>
    copies contents of "other"
  • 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
  • setEscapeCharacter,
  • setFieldSeparator,
  • setRepetitionSeparator,
  • setSubcomponentSeparator,
  • setTruncationCharacter,
  • toString

Popular in Java

  • Start an intent from android
  • onCreateOptionsMenu (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (Timer)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JTextField (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • PhpStorm for WordPress
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