/// <summary>Create a repetition with the specified ancestor, ancestor index, and exposed index.</summary> /// <param name="ancestor">Ancestor element.</param> /// <param name="parentIndex">Index in the parent splitter.</param> /// <param name="externalIndex">Exposed index.</param> public RepetitionParser(Parser ancestor, int parentIndex, int externalIndex) : base(ancestor, parentIndex, externalIndex) { _components = new WeakReferenceCache<ComponentParser>(CreateComponent); }
/// <summary>Create a field with the specified ancestor and indices.</summary> /// <param name="ancestor">Ancestor element.</param> /// <param name="parentIndex">Zero-based index within the parent's raw data.</param> /// <param name="externalIndex">Exposed index.</param> public FieldParser(Parser ancestor, int parentIndex, int externalIndex) : base(ancestor, parentIndex, externalIndex) { _repetitions = new WeakReferenceCache<RepetitionParser>(CreateRepetition); }
/// <summary>Create an encoding field.</summary> /// <param name="ancestor"></param> public EncodingFieldParser(Parser ancestor) : base(ancestor, 1, 2) { }
/// <summary>Create a field delimiter descendant.</summary> /// <param name="ancestor">Ancestor element.</param> public DelimiterFieldParser(Parser ancestor) : base(ancestor, 0, 1) { }
/// <summary>Create a subcomponent with the specified ancestor and indices.</summary> /// <param name="ancestor">Ancestor component.</param> /// <param name="index">Index within the ancestor string divider.</param> /// <param name="externalIndex">Exposed index.</param> public SubcomponentParser(Parser ancestor, int index, int externalIndex) : base(ancestor, index, externalIndex) { }
/// <summary>Create a segment with the specified ancestor and indices.</summary> /// <param name="ancestor">Ancestor element.</param> /// <param name="parentIndex">Index within the ancestor string divider.</param> /// <param name="externalIndex">Exposed index.</param> public SegmentParser(Parser ancestor, int parentIndex, int externalIndex) : base(ancestor, parentIndex, externalIndex) { _fields = new WeakReferenceCache<FieldParser>(CreateField); }
/// <summary>Create a descendant element.</summary> /// <param name="ancestor">Element's ancestor.</param> /// <param name="parentIndex">Index within the parent.</param> /// <param name="externalIndex">Index exposed externally.</param> protected DescendantParser(Parser ancestor, int parentIndex, int externalIndex) { _ancestor = ancestor; _parentIndex = parentIndex; Index = externalIndex; }
/// <summary>Create a field delimiter descendant.</summary> /// <param name="ancestor">Ancestor element.</param> /// <param name="index">Index within the ancestor.</param> /// <param name="externalIndex">Exposed index.</param> protected StaticValueFieldParser(Parser ancestor, int index, int externalIndex) : base(ancestor, index, externalIndex) { }
/// <summary>Create a component.</summary> /// <param name="ancestor">Ancestor element to pull encoding information from.</param> /// <param name="parentIndex">Zero-based index within the parent divider.</param> /// <param name="externalIndex">HL7 index to identify as.</param> public ComponentParser(Parser ancestor, int parentIndex, int externalIndex) : base(ancestor, parentIndex, externalIndex) { _subcomponents = new WeakReferenceCache<SubcomponentParser>(CreateSubcomponent); }