Package ca.uhn.hl7v2.parser

Examples of ca.uhn.hl7v2.parser.EncodingCharacters


  public void parse(String string) throws HL7Exception {
    if (string == null) {
      throw new NullPointerException("String can not be null");
    }
   
    EncodingCharacters encodingCharacters;
    try {
      encodingCharacters = EncodingCharacters.getInstance(getMessage());
    } catch (HL7Exception e) {
      throw new HL7Exception("Can not invoke parse(String) on a segment if the encoding characters (MSH-1 and MSH-2) are not already correctly set on the message");
    }
View Full Code Here


      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.
View Full Code Here

  public void parse(String string) throws HL7Exception {
    if (string == null) {
      throw new NullPointerException("String can not be null");
    }
   
    EncodingCharacters encodingCharacters;
    try {
      encodingCharacters = EncodingCharacters.getInstance(getMessage());
    } catch (HL7Exception e) {
      throw new HL7Exception(ERROR_MSH_1_OR_2_NOT_SET);
    }
View Full Code Here

    private EncodingCharacters encChars;
    private Message message;
   
    /** Creates new TreePanel */
    public TreePanel() {
        this.encChars = new EncodingCharacters('|', null);
    }
View Full Code Here

      this(new DefaultHapiContext());
  }
 
    public DefaultValidator(HapiContext context) {
        super(context);
        enc = new EncodingCharacters('|', null); // the | is assumed later -- don't change
   
View Full Code Here

        if (string == null) {
          clear();
          return;
        }
     
      EncodingCharacters encodingCharacters = EncodingCharacters.getInstance(getMessage());
        char subc = encodingCharacters.getSubcomponentSeparator();
        char cmpc = encodingCharacters.getComponentSeparator();

        clear();
       
        // If the string contains subcomponent delimiters, parse
        // these as extra components
View Full Code Here

                }
            }
        };
        FilterIterator segmentIterator = new FilterIterator(allIterator, segmentsOnly);
       
        final EncodingCharacters ec = new EncodingCharacters('|', "^~\\&");
        FilterIterator.Predicate populatedOnly = new FilterIterator.Predicate() {
            public boolean evaluate(Object obj) {
                String encoded = PipeParser.encode((Segment) obj, ec);               
                if (encoded.length() > 3) {
                    return true;
View Full Code Here

    private Message message;
   
    /** Creates new TreePanel */
    public TreePanel(PipeParser parser) {
        this.parser = parser;
        this.encChars = new EncodingCharacters('|', null);
    }
View Full Code Here

     * <p><b>Note that this method will not currently work to parse an MSH segment
     * if the encoding characters are not already set. This limitation should be
     * resulved in a future version</b></p>
     */
    public void parse(String string) throws HL7Exception {
        EncodingCharacters encodingCharacters = EncodingCharacters.getInstance(getMessage());
        clear();

        getMessage().getParser().parse(this, string, encodingCharacters);
    }
View Full Code Here

      this(new DefaultHapiContext());
  }
 
    public DefaultValidator(HapiContext context) {
        super(context);
        enc = new EncodingCharacters('|', null); // the | is assumed later -- don't change
   
View Full Code Here

TOP

Related Classes of ca.uhn.hl7v2.parser.EncodingCharacters

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.