public static IComponent GetComponent(String rawText, Context context) { if (String.IsNullOrEmpty(rawText)) return EmptyComponent.GetInstance(); else return new Component(rawText, context); }
public static IEnumerable<IComponent> GetComponents(String fieldRawText, Context context) { String[] componentStrings = fieldRawText.Split(context.ComponentSeparator); return from item in fieldRawText.Split(context.ComponentSeparator) select ComponentFactory.GetComponent(item, context); }
public static IField GetField(String rawText, Context context) { if (rawText == String.Empty) return EmptyField.GetInstance(); else if (rawText.IndexOf(context.FieldRepeatSeparator) == -1) return new NonRepeatingField(rawText, context); else return new RepeatingField(rawText, context); }
public Segment(String rawText, Context context) { this.FieldStrings = rawText.Split(context.FieldSeparator); this.Name = this.FieldStrings[0]; // Do some extra processing for MSH segment if (this.Name == "MSH") { // Add an extra field for the field separator itself (MSH-1) this.FieldStrings = new String[] { this.Name, context.FieldSeparator.ToString() }.Concat(this.FieldStrings.Skip(1)).ToArray(); // Set the HL7 version number (MSH-12) context.SetHL7Version(this.FieldStrings[12]); } this.Fields = FieldFactory.GetFields(this.FieldStrings, context).ToArray(); }
public static IEnumerable<IField> GetRepeatingFields(String repeatingField, Context context) { return (IEnumerable<IField>) from item in repeatingField.Split(context.FieldRepeatSeparator) select new FieldItem(item, context); }
public static IEnumerable<IField> GetFields(String[] fields, Context context) { return from item in fields select FieldFactory.GetField(item, context); }
public Component(String rawText, Context context) { this._Value = rawText; }
public NonRepeatingField(String rawText, Context context) { this._Value = rawText; this._Components = ComponentFactory.GetComponents(rawText, context).ToArray(); }
public RepeatingField(String rawText, Context context) { this._Value = rawText; this._Fields = FieldFactory.GetRepeatingFields(rawText, context).ToArray(); }