コード例 #1
0
        private void SaveData()
        {
            string sUserName = Session["User"].ToString();

            oDAL   = new PatientEncounterDAL();
            oClass = new PatientEncounterModel();

            oClass.EncounterNo        = EncounterNo.Value;
            oClass.EncounterDate      = Convert.ToDateTime(EncounterDate.Value);
            oClass.PatientNo          = PatientNo.Value;
            oClass.EncounterType      = ServiceType.Value;
            oClass.InsuranceCompanyID = Convert.ToInt16(ddlCompany.SelectedValue);
            oClass.InsuranceNo        = InsuranceNo.Value;
            oClass.HospitalID         = 0;// Convert.ToInt16(ddlHospitalName.SelectedValue);
            oClass.PhysicianID        = Convert.ToInt16(ddlPhysician.SelectedValue);

            oClass.Remarks  = Remarks.InnerText;
            oClass.StatusID = Convert.ToInt16(ddlStatus.SelectedValue);

            string id = "";// EncounterID.Value;

            if (id == "")
            {
                oDAL.InsertData(sUserName, oClass);
                //lblMsg.Text = "New Record has been saved";
            }
            else
            {
                oClass.ID = Convert.ToInt16(id);
                oDAL.UpdateData(sUserName, oClass);
                // lblMsg.Text = "Record has been updated";
            }
        }
コード例 #2
0
        private void PopulatePatientEncounter(string encounterNo)
        {
            oDAL   = new PatientEncounterDAL();
            oClass = new PatientEncounterModel();
            oDs    = new DataSet();

            oClass.EncounterNo = encounterNo;

            oDs = oDAL.SelectByEncounterNo(oClass);
            EncounterID.Value = oDs.Tables[0].Rows[0]["ID"].ToString();
            EncounterNo.Value = oDs.Tables[0].Rows[0]["EncounterNo"].ToString();

            EncounterDate.Value      = Convert.ToDateTime(oDs.Tables[0].Rows[0]["EncounterDate"]).ToShortDateString();
            PatientNo.Value          = oDs.Tables[0].Rows[0]["PatientNo"].ToString();
            PatientName.Value        = oDs.Tables[0].Rows[0]["PatientName"].ToString();
            DOB.Value                = Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]).ToShortDateString();
            ddlCompany.SelectedValue = oDs.Tables[0].Rows[0]["InsuranceCompanyID"].ToString();
            InsuranceNo.Value        = oDs.Tables[0].Rows[0]["InsuranceNo"].ToString();
            //  ddlHospitalName.SelectedValue = oDs.Tables[0].Rows[0]["FacilityID"].ToString();
            ServiceType.Value          = oDs.Tables[0].Rows[0]["ServiceType"].ToString();
            ddlPhysician.SelectedValue = oDs.Tables[0].Rows[0]["PhysicianID"].ToString();
            Remarks.Value           = oDs.Tables[0].Rows[0]["Remarks"].ToString();
            ddlStatus.SelectedValue = oDs.Tables[0].Rows[0]["StatusID"].ToString();

            if (oDs.Tables[0].Rows[0]["StatusID"].ToString() == "4")
            {
                btnMedCertificate.Visible = true;
                btnPrescription.Visible   = true;
                btnSave.Visible           = false;
                btnSaveDoctor.Visible     = false;
            }
        }
コード例 #3
0
        private void PopulatePatientEncounter(string encounterNo)
        {
            oDAL   = new PatientEncounterDAL();
            oClass = new PatientEncounterModel();
            oDs    = new DataSet();

            oClass.EncounterNo = encounterNo;

            oDs = oDAL.SelectByEncounterNo(oClass);
            EncounterID.Value = oDs.Tables[0].Rows[0]["ID"].ToString();
            EncounterNo.Value = oDs.Tables[0].Rows[0]["EncounterNo"].ToString();

            EncounterDate.Value          = Convert.ToDateTime(oDs.Tables[0].Rows[0]["EncounterDate"]).ToShortDateString();
            PatientNo.Value              = oDs.Tables[0].Rows[0]["PatientNo"].ToString();
            PatientNameValue.Text        = oDs.Tables[0].Rows[0]["PatientName"].ToString() + ", " + oDs.Tables[0].Rows[0]["Gender"].ToString() + ", " + CalculateAge(Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]));
            PatientName.Value            = oDs.Tables[0].Rows[0]["PatientName"].ToString();
            DOB.Value                    = Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]).ToShortDateString();
            Insurance.Value              = oDs.Tables[0].Rows[0]["CompanyName"].ToString();
            InsuranceNo.Value            = oDs.Tables[0].Rows[0]["InsuranceNo"].ToString();
            ServiceType.Value            = oDs.Tables[0].Rows[0]["ServiceType"].ToString();
            PhysicianName.Value          = oDs.Tables[0].Rows[0]["PhysicianName"].ToString();
            Remarks.Value                = oDs.Tables[0].Rows[0]["Remarks"].ToString();
            Status.Value                 = oDs.Tables[0].Rows[0]["Status"].ToString();
            ddlDisposition.SelectedValue = oDs.Tables[0].Rows[0]["dispositionID"].ToString();
            RestDays.Value               = oDs.Tables[0].Rows[0]["RestForDays"].ToString();
            Recommendation.Value         = oDs.Tables[0].Rows[0]["WorkRestriction"].ToString();
            FollowUpDate.Value           = oDs.Tables[0].Rows[0]["FollowUpDate"].ToString();

            int StatusID = Convert.ToInt16(oDs.Tables[0].Rows[0]["StatusID"]);

            if ((StatusID == 2) || (StatusID == 4))
            {
                btnSave.Visible = false;
            }
        }
コード例 #4
0
        private void SaveEncounterData(int statusID)
        {
            string sUserName = Session["User"].ToString();

            oDAL   = new PatientEncounterDAL();
            oClass = new PatientEncounterModel();

            oClass.ID            = Convert.ToInt16(EncounterID.Value);
            oClass.EncounterNo   = EncounterNo.Value;
            oClass.DispositionID = Convert.ToInt16(ddlDisposition.SelectedValue);
            if (RestDays.Value != "")
            {
                oClass.NoOfDays = Convert.ToInt16(RestDays.Value);
            }

            if (FollowUpDate.Value != "")
            {
                oClass.FollowUpDate = Convert.ToDateTime(FollowUpDate.Value);
            }

            oClass.WorkRestriction = Recommendation.InnerHtml;

            oClass.StatusID = statusID;

            oDAL.UpdateEncounterDoctorData(sUserName, oClass);

            PatientVitalsModel vitalModel = new PatientVitalsModel();
            PatientVitalsDAL   vitalDAL   = new PatientVitalsDAL();

            vitalModel.ID          = Convert.ToInt16(hfVitalsID.Value);
            vitalModel.PatientNo   = PatientNo.Value;
            vitalModel.EncounterNo = EncounterNo.Value;
            vitalModel.Temperature = VitalValue(txtTemperature.Value);
            vitalModel.Systolic    = VitalValue(txtSystolic.Value);
            vitalModel.Diastolic   = VitalValue(txtDiastolic.Value);
            vitalModel.PulseRate   = VitalValue(txtPulseRate.Value);
            vitalModel.Height      = VitalValue(txtHeight.Value);
            vitalModel.Weight      = VitalValue(txtWeight.Value);
            vitalModel.BloodSugar  = VitalValue(txtBloodSugar.Value);
            vitalModel.Notes       = txtOther.Value;

            vitalDAL.UpdateData(sUserName, vitalModel);

            PatientAssessmentModel assessmentModel = new PatientAssessmentModel();
            PatientAssessmentDAL   assessmentDAL   = new PatientAssessmentDAL();

            assessmentModel.ID             = Convert.ToInt16(hfAssessmentID.Value);
            assessmentModel.EncounterNo    = EncounterNo.Value;
            assessmentModel.PatientNo      = PatientNo.Value;
            assessmentModel.ChiefComplaint = txtCC.InnerText;
            assessmentModel.HPI            = txtHPI.InnerText;
            assessmentModel.ROS            = txtROS.InnerText;
            assessmentModel.PFSC           = txtPFSC.InnerText;
            assessmentModel.PhysicalExam   = txtPhysicalExam.InnerText;
            assessmentModel.PhysicianNote  = txtDoctorNote.InnerText;


            assessmentDAL.UpdateData(sUserName, assessmentModel);
        }
コード例 #5
0
        private void UpdateStatus(string id)
        {
            string sUserName = Session["User"].ToString();
            PatientEncounterDAL   MyPatientDAL   = new PatientEncounterDAL();
            PatientEncounterModel MyPatientClass = new PatientEncounterModel();

            MyPatientClass.EncounterNo = id;
            MyPatientClass.StatusID    = 3;
            MyPatientDAL.UpdateDataStatus(sUserName, MyPatientClass);
        }
コード例 #6
0
        public void UpdateDataStatus(string user, PatientEncounterModel oClass)
        {
            strSql = "UPDATE " + TABLE_NAME + " SET " +
                     COLUMN_STATUS + " = '" + oClass.StatusID + "', " +
                     " updated_by = '" + user + "', " +
                     " updated_date = '" + DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "' " +
                     " WHERE " + COLUMN_ENCOUNTER_NO + " = '" + oClass.EncounterNo + "' ";

            SaveData(strSql);
        }
コード例 #7
0
        private void SaveEncounterData()
        {
            string sUserName = Session["User"].ToString();

            oDAL   = new PatientEncounterDAL();
            oClass = new PatientEncounterModel();

            oClass.EncounterNo        = EncounterNo.Value;
            oClass.EncounterDate      = Convert.ToDateTime(EncounterDate.Value);
            oClass.PatientNo          = PatientNo.Value;
            oClass.EncounterType      = ServiceType.Value;
            oClass.InsuranceCompanyID = Convert.ToInt16(ddlCompany.SelectedValue);
            oClass.InsuranceNo        = InsuranceNo.Value;
            oClass.HospitalID         = 0;//Convert.ToInt16(ddlHospitalName.SelectedValue);
            oClass.PhysicianID        = Convert.ToInt16(ddlPhysician.SelectedValue);

            oClass.Remarks  = Remarks.InnerText;
            oClass.StatusID = Convert.ToInt16(ddlStatus.SelectedValue);

            PatientVitalsModel vitalModel = new PatientVitalsModel();

            vitalModel.PatientNo   = PatientNo.Value;
            vitalModel.Temperature = VitalValue(txtTemperature.Value);
            vitalModel.Systolic    = VitalValue(txtSystolic.Value);
            vitalModel.Diastolic   = VitalValue(txtDiastolic.Value);
            vitalModel.PulseRate   = VitalValue(txtPulseRate.Value);
            vitalModel.Height      = VitalValue(txtHeight.Value);
            vitalModel.Weight      = VitalValue(txtWeight.Value);
            vitalModel.BloodSugar  = VitalValue(txtBloodSugar.Value);
            vitalModel.Notes       = txtOther.Value;

            PatientAssessmentModel assessmentModel = new PatientAssessmentModel();

            assessmentModel.EncounterNo    = EncounterNo.Value;
            assessmentModel.PatientNo      = PatientNo.Value;
            assessmentModel.ChiefComplaint = txtCC.InnerText;

            string id = Request.QueryString["id"].ToString();

            if (id == "")
            {
                oDAL.InsertNewEncounterData(sUserName, oClass, assessmentModel, vitalModel);
            }
            else
            {
                oDAL.UpdateEncounterData(sUserName, oClass);

                var patientVitalDAL = new PatientVitalsDAL();
                vitalModel.EncounterNo = EncounterNo.Value;
                patientVitalDAL.UpdateDataByEncounter(sUserName, vitalModel);

                var patientAssessmentDAL = new PatientAssessmentDAL();
                patientAssessmentDAL.UpdateDataByEncounter(sUserName, assessmentModel);
            }
        }
コード例 #8
0
        private void SaveEncounterData()
        {
            string sUserName = Session["User"].ToString();

            oDAL   = new PatientEncounterDAL();
            oClass = new PatientEncounterModel();

            oClass.ID                 = Convert.ToInt16(EncounterID.Value);
            oClass.EncounterNo        = EncounterNo.Value;
            oClass.EncounterDate      = Convert.ToDateTime(EncounterDate.Value);
            oClass.PatientNo          = PatientNo.Value;
            oClass.EncounterType      = ServiceType.Value;
            oClass.InsuranceCompanyID = Convert.ToInt16(ddlCompany.SelectedValue);
            oClass.InsuranceNo        = InsuranceNo.Value;
            oClass.HospitalID         = 0;// Convert.ToInt16(ddlHospitalName.SelectedValue);
            oClass.PhysicianID        = Convert.ToInt16(ddlPhysician.SelectedValue);

            oClass.Remarks  = Remarks.InnerText;
            oClass.StatusID = Convert.ToInt16(ddlStatus.SelectedValue);

            oDAL.UpdateData(sUserName, oClass);

            PatientVitalsModel vitalModel = new PatientVitalsModel();
            PatientVitalsDAL   vitalDAL   = new PatientVitalsDAL();

            vitalModel.ID          = Convert.ToInt16(hfVitalsID.Value);
            vitalModel.PatientNo   = PatientNo.Value;
            vitalModel.EncounterNo = EncounterNo.Value;
            vitalModel.Temperature = VitalValue(txtTemperature.Value);
            vitalModel.Systolic    = VitalValue(txtSystolic.Value);
            vitalModel.Diastolic   = VitalValue(txtDiastolic.Value);
            vitalModel.PulseRate   = VitalValue(txtPulseRate.Value);
            vitalModel.Height      = VitalValue(txtHeight.Value);
            vitalModel.Weight      = VitalValue(txtWeight.Value);
            vitalModel.BloodSugar  = VitalValue(txtBloodSugar.Value);
            vitalModel.Notes       = txtOther.Value;

            vitalDAL.UpdateData(sUserName, vitalModel);

            PatientAssessmentModel assessmentModel = new PatientAssessmentModel();
            PatientAssessmentDAL   assessmentDAL   = new PatientAssessmentDAL();

            assessmentModel.ID             = Convert.ToInt16(hfAssessmentID.Value);
            assessmentModel.EncounterNo    = EncounterNo.Value;
            assessmentModel.PatientNo      = PatientNo.Value;
            assessmentModel.ChiefComplaint = txtCC.InnerText;
            assessmentModel.HPI            = txtHPI.InnerText;
            assessmentModel.ROS            = txtROS.InnerText;
            assessmentModel.PFSC           = txtPFSC.InnerText;
            assessmentModel.PhysicalExam   = txtPhysicalExam.InnerText;
            assessmentModel.PhysicianNote  = txtDoctorNote.InnerText;


            assessmentDAL.UpdateData(sUserName, assessmentModel);
        }
コード例 #9
0
        public void DeleteData(string user, PatientEncounterModel oClass)
        {
            strSql = "UPDATE " + TABLE_NAME + " SET " +
                     " isDeleted = 1, " +
                     " ReasonDelete = '" + oClass.ReasonDelete.Replace("'", "''") + "', " +
                     " updated_by = '" + user + "', " +
                     " updated_date = '" + DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "' " +
                     " WHERE " + COLUMN_ID + " = '" + oClass.ID + "' ";

            SaveData(strSql);
        }
コード例 #10
0
        protected void Ok_ServerClick(object sender, EventArgs e)
        {
            oDAL   = new PatientEncounterDAL();
            oClass = new PatientEncounterModel();
            string sUserName = Session["User"].ToString();

            oClass.IsDeleted    = true;
            oClass.ReasonDelete = itemname.InnerText;
            string lbl = lblPatientCase.Text;

            oClass.ID = Convert.ToInt32(HiddenFieldPatientCase.Value);
            oDAL.DeleteData(sUserName, oClass);
        }
コード例 #11
0
        public DataSet SelectByCaseNo(PatientEncounterModel oClass)
        {
            strSql = "SELECT A.*, Concat(B.LastName, ', ',B.FirstName) as PatientName, B.dob, Concat(C.LastName, ', ',C.FirstName) as PhysicianName, " +
                     " d.FacilityName, E.CompanyName, F.dname as Status " +
                     "FROM " + TABLE_NAME + " A Inner Join  " + ConstantConfiguration.TABLE_PATIENT + " B ON A." +
                     COLUMN_PATIENT_NO + " = B." + COLUMN_PATIENT_NO + " Left Outer Join " +
                     ConstantConfiguration.TABLE_PHYSICIAN + " C ON C.ID = A." + COLUMN_PHYSICIAN + " Left Outer Join " +
                     ConstantConfiguration.TABLE_FACILITY + " D ON D.ID = A." + COLUMN_HOSPITAL + " Left Outer Join " +
                     ConstantConfiguration.TABLE_INSURANCE + " E ON E.ID = A." + COLUMN_INSURANCE + " Left Outer Join " +
                     ConstantConfiguration.TABLE_CASE_STATUS + " F ON F.ID = A." + COLUMN_STATUS +
                     " WHERE A." + COLUMN_CASE_NO + " = '" + oClass.CaseNo + "' ";

            return(Select(strSql));
        }
コード例 #12
0
        public void UpdateEncounterDoctorData(string user, PatientEncounterModel oClass)
        {
            strSql = "UPDATE " + TABLE_NAME + " SET " +
                     COLUMN_STATUS + " = '" + oClass.StatusID + "', " +
                     COLUMN_DISPOSITION_ID + " = '" + oClass.DispositionID + "', " +
                     COLUMN_REST_DAYS + " = '" + oClass.NoOfDays + "', " +
                     COLUMN_FOLLOW_UP_DATE + " = '" + oClass.FollowUpDate + "', " +
                     COLUMN_WORK_RESTRICTION + " = '" + oClass.WorkRestriction.Replace("'", "''").Replace("\r\n", "</br>") + "', " +
                     " updated_by = '" + user + "', " +
                     " updated_date = '" + DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "' " +
                     " WHERE " + COLUMN_ID + " = '" + oClass.ID + "' ";

            SaveData(strSql);
        }
コード例 #13
0
        public DataSet SelectByEncounterNo(PatientEncounterModel oClass)
        {
            strSql = "SELECT A.*, Concat(B.FirstName, ' ',B.LastName) as PatientName, B.dob, b.gender, b.address, Concat(C.LastName, ', ',C.FirstName) as PhysicianName, " +
                     "c.licenseNo, d.FacilityName, E.CompanyName, F.dname as Status, G.dname as Disposition " +
                     "FROM " + TABLE_NAME + " A Inner Join  " + ConstantConfiguration.TABLE_PATIENT + " B ON A." +
                     COLUMN_PATIENT_NO + " = B." + COLUMN_PATIENT_NO + " Left Outer Join " +
                     ConstantConfiguration.TABLE_PHYSICIAN + " C ON C.ID = A." + COLUMN_PHYSICIAN + " Left Outer Join " +
                     ConstantConfiguration.TABLE_FACILITY + " D ON D.ID = A." + COLUMN_HOSPITAL + " Left Outer Join " +
                     ConstantConfiguration.TABLE_INSURANCE + " E ON E.ID = A." + COLUMN_INSURANCE + " Left Outer Join " +
                     ConstantConfiguration.TABLE_CASE_STATUS + " F ON F.ID = A." + COLUMN_STATUS + " Left Outer Join " +
                     ConstantConfiguration.TABLE_DISPOSITION + " G ON G.ID = A." + COLUMN_DISPOSITION_ID +
                     " WHERE A." + COLUMN_ENCOUNTER_NO + " = '" + oClass.EncounterNo + "' ";

            return(Select(strSql));
        }
コード例 #14
0
        private void PopulateGrid()
        {
            PatientEncounterDAL   MyPatientDAL   = new PatientEncounterDAL();
            PatientEncounterModel MyPatientClass = new PatientEncounterModel();
            DataSet oDs = new DataSet();

            MyPatientClass.PhysicianID = Convert.ToInt16(PhysicianID.Value);

            oDs = MyPatientDAL.SelectByPhysician(MyPatientClass);


            if (oDs != null)
            {
                gvList.DataSource = oDs.Tables[0];
                gvList.DataBind();
            }
        }
コード例 #15
0
        public void UpdateData(string user, PatientEncounterModel oClass)
        {
            strSql = "UPDATE " + TABLE_NAME + " SET " +
                     COLUMN_DATE + " = '" + oClass.EncounterDate.ToString("yyyy-MM-d HH:MM:ss") + "', " +
                     COLUMN_TYPE + " = '" + oClass.EncounterType + "', " +
                     COLUMN_INSURANCE + " = '" + oClass.InsuranceCompanyID + "', " +
                     COLUMN_INSURANCE_NO + " = '" + oClass.InsuranceNo.Replace("'", "''") + "', " +
                     COLUMN_PHYSICIAN + " = '" + oClass.PhysicianID + "', " +
                     COLUMN_HOSPITAL + " = '" + oClass.HospitalID + "', " +
                     COLUMN_STATUS + " = '" + oClass.StatusID + "', " +
                     COLUMN_REMARKS + " = '" + oClass.Remarks.Replace("'", "''") + "', " +
                     " updated_by = '" + user + "', " +
                     " updated_date = '" + DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "' " +
                     " WHERE " + COLUMN_ID + " = '" + oClass.ID + "' ";

            SaveData(strSql);
        }
コード例 #16
0
        private void PopulateGrid()
        {
            oDAL   = new PatientEncounterDAL();
            oClass = new PatientEncounterModel();
            DataSet oDs = new DataSet();

            // oClass.EncounterType = "Regular Visit";

            oDs = oDAL.SelectAll();



            if (oDs != null)
            {
                gvList.DataSource = oDs.Tables[0];
                gvList.DataBind();
            }
        }
コード例 #17
0
        private void PopulateGrid()
        {
            PatientEncounterDAL   MyPatientDAL   = new PatientEncounterDAL();
            PatientEncounterModel MyPatientClass = new PatientEncounterModel();
            DataSet oDs = new DataSet();

            MyPatientClass.PhysicianID = Convert.ToInt16(PhysicianID.Value);

            oDs = MyPatientDAL.SelectByPhysician(MyPatientClass);


            if (oDs != null)
            {
                string status = Request.QueryString["View"].ToString();

                if (status == "Pending" || status == "In Consultation")
                {
                    var activePatients = oDs.Tables[0].AsEnumerable()
                                         .Where(f => ((int)f["StatusID"]) == 1 || (int)f["StatusID"] == 3);
                    //  .Where(f => ((int)f["StatusID"]) == 3);
                    if (activePatients.Count() > 0)
                    {
                        gvList.DataSource = activePatients.CopyToDataTable();
                        gvList.DataBind();
                    }
                }

                else
                {
                    gvList.DataSource = oDs.Tables[0];
                    gvList.DataBind();
                }

                if (searchKeyword.Value != "")
                {
                    var SearchPatients = oDs.Tables[0].AsEnumerable().Where(f => ((string)f["PatientName"]).ToLower().Contains(searchKeyword.Value.ToLower()));
                    if (SearchPatients.Count() > 0)
                    {
                        gvList.DataSource = SearchPatients.CopyToDataTable();
                        gvList.DataBind();
                    }
                }
            }
        }
コード例 #18
0
        private void PopulatePatientEncounter(string encounterNo)
        {
            lblAddress.Text = "";
            var oDAL   = new PatientEncounterDAL();
            var oClass = new PatientEncounterModel();
            var oDs    = new DataSet();

            oClass.EncounterNo = encounterNo;

            oDs = oDAL.SelectByEncounterNo(oClass);

            lblDate.Text      = DateTime.Today.ToShortDateString();
            lblPatient.Text   = oDs.Tables[0].Rows[0]["PatientName"].ToString();
            lblGender.Text    = oDs.Tables[0].Rows[0]["gender"].ToString();
            lblAge.Text       = CalculateAge(Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]));
            lblPhysician.Text = oDs.Tables[0].Rows[0]["PhysicianName"].ToString();
            lblAddress.Text   = oDs.Tables[0].Rows[0]["Address"].ToString();
            //  lblEncounterDate.Text = Convert.ToDateTime(oDs.Tables[0].Rows[0]["EncounterDate"]).ToLongDateString();
            lblPhysicianLicense.Text = oDs.Tables[0].Rows[0]["licenseNo"].ToString();
        }
コード例 #19
0
        public void InsertData(string currUser, PatientEncounterModel oClass)
        {
            strSql = "Set @EncounterNo = (SELECT Concat('EN',CAST(DATE_FORMAT(curdate(),'%Y%m') AS CHAR(6)), '0001')); " +
                     "Set @LastNo = (SELECT Concat('EN', Cast(right(EncounterNo,10) + 1 AS CHAR(10))) From " + TABLE_NAME + " " +
                     "where  CAST(left(right(" + COLUMN_ENCOUNTER_NO + ",10) ,6) as CHAR (4)) =  CAST(Year(curdate()) as CHAR(4)) " +
                     "and right(left(right(" + COLUMN_ENCOUNTER_NO + ",10) ,6), 2)  =  DATE_FORMAT(curdate(),'%m') " +
                     "order by id desc Limit 1);" +
                     "Set @EncounterNo = IF (@LastNo <> '',  @LastNo,  @EncounterNo); ";

            strSql = strSql + "INSERT INTO " + TABLE_NAME + " (" +
                     COLUMN_ENCOUNTER_NO + ", " +
                     COLUMN_CASE_NO + ", " +
                     COLUMN_PATIENT_NO + ", " +
                     COLUMN_DATE + ", " +
                     COLUMN_TYPE + ", " +
                     COLUMN_INSURANCE + ", " +
                     COLUMN_INSURANCE_NO + ", " +
                     COLUMN_PHYSICIAN + ", " +
                     COLUMN_HOSPITAL + ", " +
                     COLUMN_STATUS + ", " +
                     COLUMN_REMARKS + ", " +
                     "created_by, created_date, updated_by, updated_date) ";
            strSql = strSql + "values (@EncounterNo,'" +
                     oClass.CaseNo + "', '" +
                     oClass.PatientNo + "', '" +
                     oClass.EncounterDate.ToString("yyyy-MM-d HH:MM:ss") + "', '" +
                     oClass.EncounterType + "', '" +
                     oClass.InsuranceCompanyID + "', '" +
                     oClass.InsuranceNo.Replace("'", "") + "', '" +
                     oClass.PhysicianID + "', '" +
                     oClass.HospitalID + "', '" +
                     oClass.StatusID + "', '" +
                     oClass.Remarks.Replace("'", "") + "', '" +
                     currUser + "', " +
                     "CurDate(), '" +
                     currUser + "', " +
                     "CurDate() " +
                     ") ";

            SaveData(strSql);
        }
コード例 #20
0
        private void PopulateGrid()
        {
            PatientEncounterDAL   MyPatientDAL   = new PatientEncounterDAL();
            PatientEncounterModel MyPatientClass = new PatientEncounterModel();
            DataSet oDs = new DataSet();

            MyPatientClass.PhysicianID = Convert.ToInt16(PhysicianID.Value);

            oDs = MyPatientDAL.SelectByPhysician(MyPatientClass);


            if (oDs != null)
            {
                MyPatientClass.StatusID = 1;
                var activePatients = oDs.Tables[0].AsEnumerable().Where(f => ((int)f["StatusID"]) == MyPatientClass.StatusID);
                if (activePatients.Count() > 0)
                {
                    gvList.DataSource = activePatients.CopyToDataTable();
                    gvList.DataBind();
                }
            }
        }
コード例 #21
0
        private void PopulatePatientEncounter(string encounterNo)
        {
            var oDAL   = new PatientEncounterDAL();
            var oClass = new PatientEncounterModel();
            var oDs    = new DataSet();

            oClass.EncounterNo = encounterNo;

            oDs = oDAL.SelectByEncounterNo(oClass);

            lblDate.Text      = DateTime.Today.ToShortDateString();
            lblPatient.Text   = oDs.Tables[0].Rows[0]["PatientName"].ToString();
            lblGender.Text    = oDs.Tables[0].Rows[0]["gender"].ToString();
            lblAge.Text       = CalculateAge(Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]));
            lblPhysician.Text = oDs.Tables[0].Rows[0]["PhysicianName"].ToString();

            lblEncounterDate.Text    = Convert.ToDateTime(oDs.Tables[0].Rows[0]["EncounterDate"]).ToLongDateString();
            lblPhysicianLicense.Text = oDs.Tables[0].Rows[0]["licenseNo"].ToString();

            string DisPosition     = oDs.Tables[0].Rows[0]["Disposition"].ToString();
            var    RestDay         = oDs.Tables[0].Rows[0]["RestForDays"].ToString();
            var    WorkRestriction = oDs.Tables[0].Rows[0]["WorkRestriction"].ToString();
            var    followup        = oDs.Tables[0].Rows[0]["FollowupDate"].ToString();

            lblRecomen.Text = "";
            string Recommendation = "";

            if (DisPosition != "")
            {
                Recommendation = "<br/><b>DISPOSITION</b> <br/> " + DisPosition + "<br/> </br>";
            }

            Recommendation = Recommendation + " <b> RECOMMENDATIONS </b>";
            if (RestDay != "")
            {
                Recommendation = Recommendation + "<br/>To rest for " + RestDay + "days. </br>";
            }

            if (WorkRestriction != "")
            {
                Recommendation = Recommendation + "<br/>Work restrictions as follows <br/>" + WorkRestriction;
            }

            if (followup != "")
            {
                Recommendation = Recommendation + "<br/>FollowUp Date: <br/>" + Convert.ToDateTime(followup).ToShortDateString();
            }

            lblRecomen.Text = Recommendation;

            //EncounterID.Value = oDs.Tables[0].Rows[0]["ID"].ToString();
            //EncounterNo.Value = oDs.Tables[0].Rows[0]["EncounterNo"].ToString();

            //EncounterDate.Value = Convert.ToDateTime(oDs.Tables[0].Rows[0]["EncounterDate"]).ToShortDateString();
            //PatientNo.Value = oDs.Tables[0].Rows[0]["PatientNo"].ToString();
            //PatientName.Value = oDs.Tables[0].Rows[0]["PatientName"].ToString();
            //DOB.Value = Convert.ToDateTime(oDs.Tables[0].Rows[0]["DOB"]).ToShortDateString();
            //ddlCompany.SelectedValue = oDs.Tables[0].Rows[0]["InsuranceCompanyID"].ToString();
            //InsuranceNo.Value = oDs.Tables[0].Rows[0]["InsuranceNo"].ToString();
            ////  ddlHospitalName.SelectedValue = oDs.Tables[0].Rows[0]["FacilityID"].ToString();
            //ServiceType.Value = oDs.Tables[0].Rows[0]["ServiceType"].ToString();
            //ddlPhysician.SelectedValue = oDs.Tables[0].Rows[0]["PhysicianID"].ToString();
            //Remarks.Value = oDs.Tables[0].Rows[0]["Remarks"].ToString();
            //ddlStatus.SelectedValue = oDs.Tables[0].Rows[0]["StatusID"].ToString();
        }
コード例 #22
0
        public void InsertNewEncounterData(string currUser, PatientEncounterModel oClass, PatientAssessmentModel assessmentModel, PatientVitalsModel vitalsModel)
        {
            strSql = "Set @EncounterNo = (SELECT Concat('EN',CAST(DATE_FORMAT(curdate(),'%Y%m') AS CHAR(6)), '0001')); " +
                     "Set @LastNo = (SELECT Concat('EN', Cast(right(EncounterNo,10) + 1 AS CHAR(10))) From " + TABLE_NAME + " " +
                     "where  CAST(left(right(" + COLUMN_ENCOUNTER_NO + ",10) ,6) as CHAR (4)) =  CAST(Year(curdate()) as CHAR(4)) " +
                     "and right(left(right(" + COLUMN_ENCOUNTER_NO + ",10) ,6), 2)  =  DATE_FORMAT(curdate(),'%m') " +
                     "order by id desc Limit 1);" +
                     "Set @EncounterNo = IF (@LastNo <> '',  @LastNo,  @EncounterNo); ";

            strSql = strSql + "INSERT INTO " + TABLE_NAME + " (" +
                     COLUMN_ENCOUNTER_NO + ", " +
                     COLUMN_CASE_NO + ", " +
                     COLUMN_PATIENT_NO + ", " +
                     COLUMN_DATE + ", " +
                     COLUMN_TYPE + ", " +
                     COLUMN_INSURANCE + ", " +
                     COLUMN_INSURANCE_NO + ", " +
                     COLUMN_PHYSICIAN + ", " +
                     COLUMN_HOSPITAL + ", " +
                     COLUMN_STATUS + ", " +
                     COLUMN_REMARKS + ", " +
                     "created_by, created_date, updated_by, updated_date) ";
            strSql = strSql + "values (@EncounterNo,'" +
                     oClass.CaseNo + "', '" +
                     oClass.PatientNo + "', '" +
                     oClass.EncounterDate.ToString("yyyy-MM-d HH:MM:ss") + "', '" +
                     oClass.EncounterType + "', '" +
                     oClass.InsuranceCompanyID + "', '" +
                     oClass.InsuranceNo.Replace("'", "") + "', '" +
                     oClass.PhysicianID + "', '" +
                     oClass.HospitalID + "', '" +
                     oClass.StatusID + "', '" +
                     oClass.Remarks.Replace("'", "") + "', '" +
                     currUser + "', " +
                     "CurDate(), '" +
                     currUser + "', " +
                     "CurDate() " +
                     "); ";

            var patientVitalDAL = new PatientVitalsDAL();

            strSql = strSql + patientVitalDAL.InsertData();

            strSql = strSql + "values (@EncounterNo,'" +
                     vitalsModel.PatientNo + "', '" +
                     vitalsModel.Temperature + "', '" +
                     vitalsModel.Systolic + "', '" +
                     vitalsModel.Diastolic + "', '" +
                     vitalsModel.PulseRate + "', '" +
                     vitalsModel.Height + "', '" +
                     vitalsModel.Weight + "', '" +
                     vitalsModel.BloodSugar + "', '" +
                     vitalsModel.Notes.Replace("'", "") + "', '" +
                     currUser + "', " +
                     "CurDate(), '" +
                     currUser + "', " +
                     "CurDate() " +
                     "); ";

            var patientAssessmentDAL = new PatientAssessmentDAL();

            strSql = strSql + patientAssessmentDAL.InsertData();

            strSql = strSql + "values (@EncounterNo,'" +
                     assessmentModel.PatientNo + "', '" +
                     assessmentModel.ChiefComplaint.Replace("'", "") + "', '" +
                     currUser + "', " +
                     "CurDate(), '" +
                     currUser + "', " +
                     "CurDate() " +
                     "); ";

            var logModel = new PatientEncounterLogModel();
            var logDal   = new PatientEncounterLogDAL();

            strSql = strSql + logDal.InsertData();

            strSql = strSql + "values (@EncounterNo,'" +
                     oClass.PatientNo + "', '" +
                     DateTime.Now.ToString("yyyy-MM-d HH:MM:ss") + "', '" +
                     oClass.StatusID + "', '" +
                     currUser + "', " +
                     "CurDate(), '" +
                     currUser + "', " +
                     "CurDate() " +
                     "); ";


            SaveData(strSql);
        }