///<summary>Only use this constructor when generating a message instead of parsing a message.</summary> internal FieldHL7(){ fullText=""; Components=new List<ComponentHL7>(); ComponentHL7 component; component=new ComponentHL7(""); Components.Add(component); //add more components later if needed. }
///<summary>Use this constructor when generating a message.</summary> internal FieldHL7(char[] delimiters){ _delimiters=delimiters; fullText=""; Components=new List<ComponentHL7>(); ComponentHL7 component=new ComponentHL7(""); Components.Add(component); //add more components later if needed. }
///<summary>Use this constructor when generating a message.</summary> internal FieldHL7(char[] delimiters) { _delimiters = delimiters; fullText = ""; Components = new List <ComponentHL7>(); ComponentHL7 component = new ComponentHL7(""); Components.Add(component); //add more components later if needed. }
///<summary>Only use this constructor when generating a message instead of parsing a message.</summary> internal FieldHL7() { fullText = ""; Components = new List <ComponentHL7>(); ComponentHL7 component; component = new ComponentHL7(""); Components.Add(component); //add more components later if needed. }
///<summary>This also resets the number of components. And it sets fullText.</summary> public void SetVals(params string[] values){ if(values.Length==1) { FullText=values[0];//this allows us to pass in all components for the field as one long string: comp1^comp2^comp3 return; } fullText=""; Components=new List<ComponentHL7>(); ComponentHL7 component; for(int i=0;i<values.Length;i++) { component=new ComponentHL7(values[i]); Components.Add(component); fullText+=values[i]; if(i<values.Length-1) { fullText+="^"; } } }
///<summary>This also resets the number of components. And it sets fullText.</summary> public void SetVals(params string[] values) { if (values.Length == 1) { FullText = values[0]; //this allows us to pass in all components for the field as one long string: comp1^comp2^comp3 return; } fullText = ""; Components = new List <ComponentHL7>(); ComponentHL7 component; for (int i = 0; i < values.Length; i++) { component = new ComponentHL7(values[i], _delimiters[2]); Components.Add(component); fullText += values[i]; if (i < values.Length - 1) { fullText += _delimiters[0]; } } }