Example #1
0
        public List <string> validationReport  = new List <string>();//this will create a list of strings that report illegal values in the HL7 message

        public List <string> Validate(HL7Message shl7m, string cdmFilename)
        {
            List <CDMCode> codes = allCDMCodes.AllCodesToBeMapped(cdmFilename);//CDM codes to be mapped for this segment

            try
            {
                foreach (CDMCode code in codes)
                {
                    /*string segmentField = fields[int.Parse(code.Field)];//----------this try catch is mainly for this being out of bounds.
                     * string segmentComponent = fields[Int32.Parse(code.Component)];//this try catch is mainly for this being out of bounds.
                     *
                     * if (code.Segment == segmentType)
                     * {
                     *  if (segmentField == code.Field & segmentComponent == code.Component)
                     *  {
                     *      Console.WriteLine("segmentField == cdmCodeField & segmentComponent == codeComponent");
                     *      if (code.CodeValue == fields[Int32.Parse(code.Field) - 1])//todo: validate entire range of possible code values for that component
                     *      {
                     *          //happy path
                     *      }
                     *  }
                     *
                     * }*/
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("there has been an exception:" + e.Message);
            }

            return(validationReport);
        }
Example #2
0
        private void Button4_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = "c:\\";
            //openFileDialog1.Filter = "Excel Files| *.xls; *.xlsx";
            openFileDialog1.FilterIndex      = 2;
            openFileDialog1.RestoreDirectory = true;

            string     x = "debug";
            HL7Message h = new HL7Message(x);//---------------------------------------------debug

            string wah = h.Segments[0].Fields[0].Subfields[0].SubSubfields[0].ToString();
            string boo = h.Segments[0].Fields[0].Subfields[0].ToString();
            string res = h.Segments[0].Fields[0].ToString();
            string bla = h.Segments[0].ToString();
            string pez = h.Segments[0].