Пример #1
0
 public static IComponent GetComponent(String rawText, Context context)
 {
     if (String.IsNullOrEmpty(rawText))
         return EmptyComponent.GetInstance();
     else
         return new Component(rawText, context);
 }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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();
        }
Пример #5
0
 public static IEnumerable<IField> GetRepeatingFields(String repeatingField, Context context)
 {
     return (IEnumerable<IField>)
         from item in repeatingField.Split(context.FieldRepeatSeparator)
         select new FieldItem(item, context);
 }
Пример #6
0
 public static IEnumerable<IField> GetFields(String[] fields, Context context)
 {
     return
         from item in fields
         select FieldFactory.GetField(item, context);
 }
Пример #7
0
 public Component(String rawText, Context context)
 {
     this._Value = rawText;
 }
Пример #8
0
 public NonRepeatingField(String rawText, Context context)
 {
     this._Value = rawText;
     this._Components = ComponentFactory.GetComponents(rawText, context).ToArray();
 }
Пример #9
0
 public RepeatingField(String rawText, Context context)
 {
     this._Value = rawText;
     this._Fields = FieldFactory.GetRepeatingFields(rawText, context).ToArray();
 }