public MessageSample(string messageSampleText) { string[] ss = messageSampleText.Split((char)28); foreach (string s in ss) { HL7Message h = new HL7Message(s); HL7Messages.Add(h); } }
//Constructor public Assertion(HL7Message msg, AllCDMCodes acs) { DataTable t = GetCMM(); foreach (Segment s in msg) { string segName = s.value.Substring(0, 3); Console.WriteLine(segName + " segName");//---------------------------debug DataRow[] r = t.Select("Segment = '" + segName + "'"); if (string.IsNullOrEmpty(r.ToString())) { Console.WriteLine("empty"); } else { DataRow[] fieldAndSubfields = t.Select("Segment like '" + segName + "'"); foreach (DataRow item in fieldAndSubfields) { //get CMM field\subfield values try { if (!string.IsNullOrEmpty(s.Fields[3].value)) {//if this field has a value... Console.WriteLine(s.Fields[3].value + " 1 is clearly not null"); if (!string.IsNullOrEmpty(s.Fields[3].SubFields[0].value)) { Console.WriteLine(s.Fields[3].SubFields[0].value + " 2 is clearly not null"); if (!string.IsNullOrEmpty(s.Fields[3].SubFields[0].SubSubFields[0].value)) { Console.WriteLine(s.Fields[3].SubFields[0].SubSubFields[0].value + " 3 is clearly not null"); } } } } catch (ArgumentOutOfRangeException ex) { Console.WriteLine("ArgumentOutOfRangeException ex"); } } } } }