//validation implementation

        public static bool button_Clicked(int MRN)
        {
            if (PatientDOB == null)
            {
                PatientDOB = (DateTime?)DateTime.Now;
                //MessageBox.Show("hhhh" + PatientDOB.ToString());
            }

            if (ReferringPhysicianName == null)
            {
                ReferringPhysicianName = "";
            }

            if (PerformingPhysicianName == null)
            {
                PerformingPhysicianName = "";
            }

            if (PatientMiddleName == null)
            {
                PatientMiddleName = "";
            }

            if (PatientFirstName == null)
            {
                PatientFirstName = "";
            }


            //validation check
            RIS_InputFieldValidation obj = new RIS_InputFieldValidation();
            bool result = obj.validation_check(PatientFirstName, PatientMiddleName, PatientLastName, ReferringPhysicianName, PerformingPhysicianName);

            if (result == false)
            {
                // MessageBox.Show("Enter character should not be between [//, /,:,?,*,<,>,|] ");
                return(false);
            }


            else if (result == true)
            {
                RISDataManager risDataManager = new RISDataManager("PIC" + MRN, PatientInitials, PatientFirstName, PatientMiddleName, PatientLastName, CheckInDate, CheckInTime, PatientBloodGroup, PatientGender, (DateTime)PatientDOB, ModalityName, ExamType, ReferringPhysicianName, PerformingPhysicianName);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        public void When_InValidInputCharacters_Given_DontProceedToModality()
        {
            // RIS_ViewModel ris_ViewModel = new RIS_ViewModel();
            RIS_InputFieldValidation ris_InputFieldValidation = new RIS_InputFieldValidation();
            string patientFirstName        = "Alka<<";
            string patientMiddleName       = "kumari";
            string patientLastName         = "choudhary";
            string referringPhysicianName  = "Dr Shashi bhushan";
            string performingPhysicianName = "Dr kiran";

            bool expectedResult = false;

            bool actualResult = ris_InputFieldValidation.validation_check(patientFirstName, patientMiddleName, patientLastName, referringPhysicianName, performingPhysicianName);

            Assert.AreEqual(actualResult, expectedResult);
        }