public static Admission SearchAdmission(string patientID)
        {
            Admission admission = null;

            using (DAL dal = new DAL())
            {
                SqlParameter[] spParams =
                {
                    new SqlParameter("@patientID", patientID),
                };

                var data = dal.ExecuteQuery("spSearchAdmittedPatient", spParams).Tables[0];

                foreach (DataRow dr in data.AsEnumerable())
                {
                    admission = new Admission()
                    {
                        id      = dr.Field <int>(0),
                        patient = new Patient()
                        {
                            id         = dr.Field <string>(1),
                            firstname  = dr.Field <string>(2),
                            middlename = dr.Field <string>(3),
                            lastname   = dr.Field <string>(4),
                        }
                    };
                }
                return(admission);
            }
        }
        public static int SaveAdmission(Admission admission)
        {
            using (DAL dal = new DAL())
            {
                SqlParameter[] spParams =
                {
                    new SqlParameter("@id",             admission.id),
                    new SqlParameter("@patientID",      admission.patient.id),
                    new SqlParameter("@admittedDate",   admission.admittedDate),
                    new SqlParameter("@admittedTime",   admission.admittedTime),
                    new SqlParameter("@dischargeDate",  admission.dischargedDate),
                    new SqlParameter("@dischargeTime",  admission.dischargedTime),
                    new SqlParameter("@timesAdmitted",  admission.timesAdmitted),
                    new SqlParameter("@ward",           admission.ward),
                    new SqlParameter("@roomNo",         admission.roomNo),
                    new SqlParameter("@bedNo",          admission.bedNo),
                    new SqlParameter("@fatherName",     admission.fatherName),
                    new SqlParameter("@fAddress",       admission.fAddress),
                    new SqlParameter("@fOccupation",    admission.fOccupation),
                    new SqlParameter("@fEmployer",      admission.fEmployer),
                    new SqlParameter("@motherName",     admission.motherName),
                    new SqlParameter("@mAddress",       admission.mAddress),
                    new SqlParameter("@mOccupation",    admission.mOccupation),
                    new SqlParameter("@mEmployer",      admission.mEmployer),
                    new SqlParameter("@spouseName",     admission.spouseName),
                    new SqlParameter("@sAddress",       admission.sAddress),
                    new SqlParameter("@sOccupation",    admission.sOccupation),
                    new SqlParameter("@sEmployer",      admission.sEmployer),
                    new SqlParameter("@captainName",    admission.captainName),
                    new SqlParameter("@companionName",  admission.companionName),
                    new SqlParameter("@cRelationship",  admission.cRelationship),
                    new SqlParameter("@cAddress",       admission.cAddress),
                    new SqlParameter("@eName",          admission.eName),
                    new SqlParameter("@eRelationship",  admission.eRelationship),
                    new SqlParameter("@eAddress",       admission.eAddress),
                    new SqlParameter("@contact",        admission.contact),
                    new SqlParameter("@isAdmitted",     admission.isAdmitted),
                    new SqlParameter("@isDischarged",   admission.isDischarged),
                    new SqlParameter("@isTransferred ", admission.isTransferred),
                    new SqlParameter("@employeeID ",    admission.doctorID),
                    new SqlParameter("@bp",             admission.blood_pressure),
                    new SqlParameter("@temperature",    admission.temperature),
                    new SqlParameter("@pr",             admission.pulse_rate),
                    new SqlParameter("@cc",             admission.cc),
                    new SqlParameter("@rr",             admission.respiratory_rate),
                    new SqlParameter("@gcs",            admission.gcs),
                    new SqlParameter("@o2sat",          admission.o2sat),
                    new SqlParameter("@nurseID",        admission.nurseID),
                };

                try
                {
                    dal.ExecuteQuery("spSaveAdmission", spParams);
                    return(1);
                }
                catch (Exception)
                {
                    return(0);
                }
            }
        }