Ejemplo n.º 1
0
 protected override void FullyParse()
 {
     if (!string.IsNullOrEmpty(Value))
     {
         var fields = Value.TrimEnd(Encoding.FieldSeparator).Split(Encoding.FieldSeparator).ToList();
         Fields.Clear();
         for (int i = 0; i < fields.Count; i++)
         {
             string field = fields[i];
             if (Name == "MSH" && i == 1)
             {
                 Fields.Add(Hl7Field.Parse(field, Encoding, doNotEscape: true));
             }
             else
             {
                 Fields.Add(Hl7Field.Parse(field, Encoding));
             }
         }
         IsParsed = true;
         Value    = null;
     }
 }
Ejemplo n.º 2
0
 public override Hl7Element this[int i]
 {
     get
     {
         EnsureFullyParsed();
         if (Fields.Count > i)
         {
             return(Fields[i]);
         }
         var field = Hl7Field.Parse("", Encoding);
         this[i] = field;
         return(field);
     }
     set
     {
         EnsureFullyParsed();
         for (int j = Fields.Count; j <= i; j++)
         {
             Fields.Add(new Hl7Field());
         }
         Fields[i] = (Hl7Field)value;
     }
 }
Ejemplo n.º 3
0
 public static Hl7Segment operator +(Hl7Segment segment, string field)
 {
     segment += Hl7Field.Parse(field, segment.Encoding);
     return(segment);
 }