示例#1
0
        public ArrayList GetChronicIllness()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT = patientEncounter.loadPatientEncounterChronicIllness(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            ArrayList rows  = new ArrayList();

            foreach (DataRow row in theDT.Rows)
            {
                string active = "";
                if (row["active"].ToString() == "1")
                {
                    active = "checked";
                }
                else
                {
                    active = "";
                }

                string[] i = new string[7] {
                    row["chronicIllnessID"].ToString(), row["chronicIllnessName"].ToString(), row["Treatment"].ToString(), row["dose"].ToString(), row["OnsetDate"].ToString(),
                    "<input type='checkbox' id='chkChronic" + row["chronicIllnessID"].ToString() + "' " + active + " >",
                    "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>"
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#2
0
        public ArrayList GetRegimensBasedOnRegimenLine(string RegimenLine)
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT = patientEncounter.getPharmacyRegimens(RegimenLine);
            ArrayList rows  = new ArrayList();

            foreach (DataRow row in theDT.Rows)
            {
                string[] i = new string[2] {
                    row["LookupItemId"].ToString(), row["DisplayName"].ToString()
                };
                rows.Add(i);
            }
            return(rows);

            /////////////////////
            //var result = LookupLogic.GetLookUpItemViewByMasterName(RegimenLine);

            //JavaScriptSerializer parser = new JavaScriptSerializer();
            //var regimen = parser.Deserialize<List<KeyValue>>(result);

            //ArrayList rows = new ArrayList();

            //for (int i = 0; i < regimen.Count; i++)
            //{
            //    string[] j = new string[2] { regimen[i].ItemId, regimen[i].DisplayName };
            //    rows.Add(j);
            //}
            //return rows;
        }
        public int GenerateExcel(string category)
        {
            PatientEncounterLogic pel = new PatientEncounterLogic();

            pel.GenerateExcel(category);
            return(0);
        }
示例#4
0
        void LoadExistingData()
        {
            LookupLogic           lookUp         = new LookupLogic();
            PatientEncounterLogic encounterLogic = new PatientEncounterLogic();

            List <Entities.CCC.Encounter.PatientEncounter.PharmacyFields> lst = encounterLogic.getPharmacyFields(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString());

            if (lst.Count > 0)
            {
                ddlTreatmentProgram.SelectedValue = lst[0].TreatmentProgram;
                ddlPeriodTaken.SelectedValue      = lst[0].PeriodTaken;
                ddlTreatmentPlan.SelectedValue    = lst[0].TreatmentPlan;

                DataTable theDT = encounterLogic.getPharmacyDrugSwitchInterruptionReason(ddlTreatmentPlan.SelectedValue);
                ddlSwitchInterruptionReason.Items.Add(new ListItem("Select", "0"));
                for (int i = 0; i < theDT.Rows.Count; i++)
                {
                    ddlSwitchInterruptionReason.Items.Add(new ListItem(theDT.Rows[i]["DisplayName"].ToString(), theDT.Rows[i]["LookupItemId"].ToString()));
                }
                ddlSwitchInterruptionReason.SelectedValue = lst[0].TreatmentPlanReason;
                //ScriptManager.RegisterStartupScript(this, this.GetType(), "treatmentPlan", "drugSwitchInterruptionReason(" + ddlTreatmentPlan.SelectedValue + ");", true);

                regimenLine.SelectedValue = lst[0].RegimenLine;
                //////////////////////////////////////////////////////////////////////////////////////

                //var masterName = Regex.Replace(regimenLine.SelectedItem.Text, @"\s+", "");
                var masterName = regimenLine.SelectedItem.Text.Replace(" ", String.Empty);

                ///////////////////////////////////////////////////////////////////////////
                PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

                DataTable theDTReg = patientEncounter.getPharmacyRegimens(masterName);
                ddlRegimen.Items.Add(new ListItem("Select", "0"));

                foreach (DataRow row in theDTReg.Rows)
                {
                    ddlRegimen.Items.Add(new ListItem(row["DisplayName"].ToString(), row["LookupItemId"].ToString()));
                }
                ////////////////////////////////////////////

                //var result = LookupLogic.GetLookUpItemViewByMasterName(masterName);

                //JavaScriptSerializer parser = new JavaScriptSerializer();
                //var regimen = parser.Deserialize<List<Entities.CCC.Encounter.PatientEncounter.KeyValue>>(result);
                //ddlRegimen.Items.Add(new ListItem("Select", "0"));
                //for (int i = 0; i < regimen.Count; i++)
                //{
                //    ddlRegimen.Items.Add(new ListItem(regimen[i].DisplayName, regimen[i].ItemId));
                //}
                /////////////////////////////////////////////////////////////////////////////////////////
                ddlRegimen.SelectedValue = lst[0].Regimen;
                txtPrescriptionDate.Text = lst[0].prescriptionDate;
                txtPrescriptionDate.Text = lst[0].dispenseDate;

                prescriptionDate = lst[0].prescriptionDate;
                dispenseDate     = lst[0].dispenseDate;
                //ScriptManager.RegisterStartupScript(this, this.GetType(), "regimen", "selectRegimens(" + regimenLine.SelectedValue + ");", true);
            }
        }
示例#5
0
        public int savePatientEncounterTS(string VisitDate, string VisitScheduled, string VisitBy)
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            int val = patientEncounter.savePatientEncounterTS(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString(), "203", VisitDate, VisitScheduled, VisitBy, Convert.ToInt32(Session["AppUserId"].ToString()));

            return(val);
        }
示例#6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["visitId"] != null)
            {
                Session["ExistingRecordPatientMasterVisitID"] = Request.QueryString["visitId"].ToString();
            }
            else
            {
                Session["ExistingRecordPatientMasterVisitID"] = "0";
            }

            if (!IsPostBack)
            {
                if (Session["SCMModule"] != null)
                {
                    PMSCM = Session["SCMModule"].ToString();
                }

                if (Session["SCMSamePointDispense"] != null)
                {
                    PMSCMSAmePointDispense = Session["SCMSamePointDispense"].ToString();
                }

                LookupLogic lookUp = new LookupLogic();
                PatientTreatmentTrackerManager treatmentTrackerManager = new PatientTreatmentTrackerManager();

                StartTreatment = treatmentTrackerManager.HasPatientTreatmentStarted(Convert.ToInt32(Session["PatientPK"].ToString()));

                int patientType = Convert.ToInt32(Session["PatientType"].ToString());
                patType = LookupLogic.GetLookupNameById(patientType).ToLower();

                if (patType == "transit")
                {
                    StartTreatment = true;
                }
                //lookUp.populateDDL(ddlTreatmentProgram, "TreatmentProgram");
                lookUp.populateDDL(ddlPeriodTaken, "PeriodDrugsTaken");
                lookUp.populateDDL(ddlTreatmentPlan, "TreatmentPlan");
                if (Convert.ToInt32(Session["Age"]) > 14)
                {
                    lookUp.populateDDL(regimenLine, "RegimenClassificationAdult", "RegimenClassificationPaeds");
                }
                else
                {
                    lookUp.populateDDL(regimenLine, "RegimenClassificationPaeds");
                }

                //lookUp.getPharmacyDrugFrequency(ddlFreq);

                PatientEncounterLogic pel = new PatientEncounterLogic();
                pel.getPharmacyTreatmentProgram(ddlTreatmentProgram);

                LoadExistingData();
                var patientEnrollment = new PatientEnrollmentManager();
                var enrolDate         = patientEnrollment.GetPatientEnrollmentDate(Convert.ToInt32(Session["PatientPK"]));
                enrolmentDate = enrolDate.Date.ToString();
            }
        }
示例#7
0
        public int savePatientEncounterPresentingComplaints(string VisitDate, string VisitScheduled, string VisitBy, string anyComplaints, string Complaints, int TBScreening, int NutritionalStatus, string adverseEvent, string presentingComplaints)
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            int val = patientEncounter.savePatientEncounterPresentingComplaints(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString(), "203", VisitDate, VisitScheduled, VisitBy, anyComplaints, Complaints, TBScreening, NutritionalStatus, Convert.ToInt32(Session["AppUserId"].ToString()), adverseEvent, presentingComplaints);


            return(val);
        }
示例#8
0
        public ArrayList LoadWorkPlan()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT = patientEncounter.getPatientWorkPlan(Session["PatientPK"].ToString());
            ArrayList rows  = new ArrayList();

            foreach (DataRow row in theDT.Rows)
            {
                string[] i = new string[2] {
                    row["visitDate"].ToString(), row["clinicalNotes"].ToString()
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#9
0
        public ArrayList GetPhysicalExam()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT = patientEncounter.loadPatientEncounterPhysicalExam(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            ArrayList rows  = new ArrayList();

            foreach (DataRow row in theDT.Rows)
            {
                string[] i = new string[7] {
                    row["examTypeID"].ToString(), row["examID"].ToString(), row["findingID"].ToString(), row["examType"].ToString(), row["exam"].ToString(), row["findings"].ToString(), "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>"
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#10
0
        public ArrayList GetDrugList(string PMSCM, string treatmentPlan)
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT = patientEncounter.getPharmacyDrugList(PMSCM, treatmentPlan);
            ArrayList rows  = new ArrayList();

            foreach (DataRow row in theDT.Rows)
            {
                string[] i = new string[2] {
                    row["val"].ToString(), row["DrugName"].ToString()
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#11
0
        public ArrayList GetDiagnosis()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT = patientEncounter.loadPatientEncounterDiagnosis(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            ArrayList rows  = new ArrayList();

            foreach (DataRow row in theDT.Rows)
            {
                string[] i = new string[4] {
                    row["Diagnosis"].ToString(), row["DisplayName"].ToString(), row["ManagementPlan"].ToString(), "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>"
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#12
0
        public ArrayList LoadComplaints()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT = patientEncounter.loadPatientEncounterComplaints(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            ArrayList rows  = new ArrayList();

            foreach (DataRow row in theDT.Rows)
            {
                string[] i = new string[4] {
                    row["presentingComplaintsId"].ToString(), row["complaint"].ToString(), row["onsetDate"].ToString(), "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>"
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#13
0
        public ArrayList GetDrugBatches(string DrugPk)
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            List <Entities.CCC.Encounter.PatientEncounter.DrugBatch> lst = patientEncounter.getPharmacyDrugBatch(DrugPk);

            ArrayList rows = new ArrayList();

            for (int i = 0; i < lst.Count; i++)
            {
                string[] j = new string[2] {
                    lst[i].id, lst[i].batch
                };
                rows.Add(j);
            }
            return(rows);
        }
示例#14
0
        public ArrayList DifferentiatedCareParameters()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            PatientEncounter.PatientCategorizationParameters categorizationParameters = new PatientEncounter.PatientCategorizationParameters();
            categorizationParameters = patientEncounter.getPatientDSDParameters(Session["PatientPK"].ToString());

            ArrayList rows = new ArrayList();

            double[] i = new double[6] {
                categorizationParameters.SameRegimen12Months, categorizationParameters.ActiveOIs, categorizationParameters.VL, categorizationParameters.Completed6MonthsIPT, categorizationParameters.BMI, categorizationParameters.age
            };
            rows.Add(i);


            return(rows);
        }
示例#15
0
        public ArrayList GetPharmacyPendingPrescriptions()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT = patientEncounter.getPharmacyPendingPrescriptions(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            ArrayList rows  = new ArrayList();

            foreach (DataRow row in theDT.Rows)
            {
                string[] i = new string[7] {
                    row["PatientMasterVisitID"].ToString(), row["Ptn_pk"].ToString(),
                    row["identifiervalue"].ToString(), row["FirstName"].ToString(), row["MidName"].ToString(),
                    row["LastName"].ToString(), row["prescribedBy"].ToString()
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#16
0
        public ArrayList GetAllergies()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT = patientEncounter.loadPatientEncounterAllergies(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            ArrayList rows  = new ArrayList();

            foreach (DataRow row in theDT.Rows)
            {
                string[] i = new string[8] {
                    row["allergyId"].ToString(), row["reactionId"].ToString(), row["severityId"].ToString(),
                    row["allergy"].ToString(), row["reaction"].ToString(), row["severity"].ToString(),
                    row["onsetDate"].ToString(), "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>"
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#17
0
        public ArrayList GetCurrentRegimen()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            List <Entities.CCC.Encounter.PatientEncounter.PharmacyFields> lst = new List <Entities.CCC.Encounter.PatientEncounter.PharmacyFields>();

            lst = patientEncounter.getPharmacyCurrentRegimen(Session["PatientPK"].ToString());

            ArrayList rows = new ArrayList();

            if (lst.Count > 0)
            {
                string[] i = new string[2] {
                    lst[0].RegimenLine, lst[0].Regimen
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#18
0
        public int savePatientPharmacy(string TreatmentProgram, string PeriodTaken, string TreatmentPlan,
                                       string TreatmentPlanReason, string RegimenLine, string Regimen, string pmscm, string PrescriptionDate,
                                       string DispensedDate, string drugPrescription, string regimenText)
        {
            try
            {
                PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

                int val = patientEncounter.saveUpdatePharmacy(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString(),
                                                              Session["AppLocationId"].ToString(), Session["AppUserId"].ToString(), Session["AppUserId"].ToString(),
                                                              Session["AppUserId"].ToString(), RegimenLine, Session["ModuleId"].ToString(), pmscm, drugPrescription,
                                                              TreatmentProgram, PeriodTaken, TreatmentPlan, TreatmentPlanReason, Regimen, regimenText, PrescriptionDate,
                                                              DispensedDate);
                return(val);
            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }
示例#19
0
        public ArrayList GetLatestPharmacyPrescriptionDetails()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT  = patientEncounter.loadPatientLatestPharmacyPrescription(Session["PatientPK"].ToString(), Session["AppLocationId"].ToString());
            ArrayList rows   = new ArrayList();
            string    remove = "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>";

            foreach (DataRow row in theDT.Rows)
            {
                string[] i = new string[13] {
                    row["Drug_Pk"].ToString(), row["batchId"].ToString(),
                    row["FrequencyID"].ToString(), row["abbr"].ToString(), row["DrugName"].ToString(),
                    row["batchName"].ToString(), row["dose"].ToString(), row["freq"].ToString(),
                    row["duration"].ToString(), row["OrderedQuantity"].ToString(), row["DispensedQuantity"].ToString(),
                    row["prophylaxis"].ToString(), remove
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#20
0
        public ArrayList GetPharmacyPrescriptionDetails()
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT  = patientEncounter.loadPatientPharmacyPrescription(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString());
            ArrayList rows   = new ArrayList();
            string    remove = "";

            foreach (DataRow row in theDT.Rows)
            {
                if (row["DispensedQuantity"].ToString() == "")
                {
                    remove = "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>";
                }
                else
                {
                    if (Convert.ToDecimal(row["DispensedQuantity"].ToString()) == 0)
                    {
                        remove = "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>";
                    }
                    else
                    {
                        remove = "<button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' disabled> Remove</button>";
                    }
                }

                string[] i = new string[13] {
                    row["Drug_Pk"].ToString(), row["batchId"].ToString(),
                    row["FrequencyID"].ToString(), row["abbr"].ToString(), row["DrugName"].ToString(),
                    row["batchName"].ToString(), row["dose"].ToString(), row["freq"].ToString(),
                    row["duration"].ToString(), row["OrderedQuantity"].ToString(), row["DispensedQuantity"].ToString(),
                    row["prophylaxis"].ToString(), remove
                };
                rows.Add(i);
            }
            return(rows);
        }
示例#21
0
        public ArrayList getZScoreValues(string height, string weight)
        {
            ArrayList result = new ArrayList();
            string    weightForAgeResult = "", weightForHeight = "", BMIz = "";

            if (height != "" && weight != "")
            {
                PatientEncounterLogic patientEncounter = new PatientEncounterLogic();
                Entities.CCC.Encounter.PatientEncounter.ZScores zsValues = new Entities.CCC.Encounter.PatientEncounter.ZScores();
                zsValues = patientEncounter.getZScores(Session["PatientPK"].ToString(), Convert.ToDouble(Session["Age"].ToString()), Session["Gender"].ToString(), Convert.ToDouble(height), Convert.ToDouble(weight));

                if (zsValues != null)
                {
                    //weight for age
                    if (zsValues.weightForAge >= 4)
                    {
                        weightForAgeResult = "4 (Overweight)";
                    }
                    else if (zsValues.weightForAge >= 3 && zsValues.weightForAge < 4)
                    {
                        weightForAgeResult = "3 (Overweight)";
                    }
                    else if (zsValues.weightForAge >= 2 && zsValues.weightForAge < 3)
                    {
                        weightForAgeResult = "2 (Overweight)";
                    }
                    else if (zsValues.weightForAge >= 1 && zsValues.weightForAge < 2)
                    {
                        weightForAgeResult = "1 (Overweight)";
                    }
                    else if (zsValues.weightForAge > -1 && zsValues.weightForAge < 1)
                    {
                        weightForAgeResult = "0 (Normal)";
                    }
                    else if (zsValues.weightForAge <= -1 && zsValues.weightForAge > -2)
                    {
                        weightForAgeResult = "-1 (Mild)";
                    }
                    else if (zsValues.weightForAge <= -2 && zsValues.weightForAge > -3)
                    {
                        weightForAgeResult = "-2 (Moderate)";
                    }
                    else if (zsValues.weightForAge <= -3 && zsValues.weightForAge > -4)
                    {
                        weightForAgeResult = "-3 (Severe)";
                    }
                    else if (zsValues.weightForAge <= -4)
                    {
                        weightForAgeResult = "-4 (Severe)";
                    }
                    else
                    {
                        weightForAgeResult = "Out of Range";
                    }

                    //weight for height
                    if (zsValues.weightForHeight >= 4)
                    {
                        weightForHeight = "4 (Overweight)";
                    }
                    else if (zsValues.weightForHeight >= 3 && zsValues.weightForHeight < 4)
                    {
                        weightForHeight = "3 (Overweight)";
                    }
                    else if (zsValues.weightForHeight >= 2 && zsValues.weightForHeight < 3)
                    {
                        weightForHeight = "2 (Overweight)";
                    }
                    else if (zsValues.weightForHeight >= 1 && zsValues.weightForHeight < 2)
                    {
                        weightForHeight = "1 (Overweight)";
                    }
                    else if (zsValues.weightForHeight > -1 && zsValues.weightForHeight < 1)
                    {
                        weightForHeight = "0 (Normal)";
                    }
                    else if (zsValues.weightForHeight <= -1 && zsValues.weightForHeight > -2)
                    {
                        weightForHeight = "-1 (Mild)";
                    }
                    else if (zsValues.weightForHeight <= -2 && zsValues.weightForHeight > -3)
                    {
                        weightForHeight = "-2 (Moderate)";
                    }
                    else if (zsValues.weightForHeight <= -3 && zsValues.weightForHeight > -4)
                    {
                        weightForHeight = "-3 (Severe)";
                    }
                    else if (zsValues.weightForHeight <= -4)
                    {
                        weightForHeight = "-4 (Severe)";
                    }
                    else
                    {
                        weightForHeight = "Out of Range";
                    }

                    //BMIz
                    if (zsValues.BMIz >= 4)
                    {
                        BMIz = "4 (Overweight)";
                    }
                    else if (zsValues.BMIz >= 3 && zsValues.BMIz < 4)
                    {
                        BMIz = "3 (Overweight)";
                    }
                    else if (zsValues.BMIz >= 2 && zsValues.BMIz < 3)
                    {
                        BMIz = "2 (Overweight)";
                    }
                    else if (zsValues.BMIz >= 1 && zsValues.BMIz < 2)
                    {
                        BMIz = "1 (Overweight)";
                    }
                    else if (zsValues.BMIz > -1 && zsValues.BMIz < 1)
                    {
                        BMIz = "0 (Normal)";
                    }
                    else if (zsValues.BMIz <= -1 && zsValues.BMIz > -2)
                    {
                        BMIz = "-1 (Mild)";
                    }
                    else if (zsValues.BMIz <= -2 && zsValues.BMIz > -3)
                    {
                        BMIz = "-2 (Moderate)";
                    }
                    else if (zsValues.BMIz <= -3 && zsValues.BMIz > -4)
                    {
                        BMIz = "-3 (Severe)";
                    }
                    else if (zsValues.BMIz <= -4)
                    {
                        BMIz = "-4 (Severe)";
                    }
                    else
                    {
                        BMIz = "Out of Range";
                    }



                    string[] i = new string[3] {
                        weightForAgeResult, weightForHeight, BMIz
                    };
                    result.Add(i);
                }
            }
            return(result);
        }
示例#22
0
        public void savePatientPhysicalExam(string physicalExam, string generalExam)
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            patientEncounter.savePatientEncounterPhysicalExam(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString(), Session["AppUserId"].ToString(), physicalExam, generalExam);
        }
        public string GetPatientMasterVisitId(int PatientId, DateTime visitDate, string EncounterType, int ServiceAreaId, int UserId)
        {
            PatientMasterVisitManager pmvManager       = new PatientMasterVisitManager();
            List <PatientMasterVisit> pmv              = new List <PatientMasterVisit>();
            PatientEncounterLogic     patientEncounter = new PatientEncounterLogic();
            OutCome ResultOutcome = new OutCome();

            pmv = pmvManager.GetPatientMasterVisitBasedonVisitDate(PatientId, visitDate);
            if (pmv != null)
            {
                if (pmv.Count > 0)
                {
                    MasterVisitId = pmv[0].Id;
                }
            }


            if (MasterVisitId > 0)
            {
                Result = patientEncounter.SavePatientPreviousEncounter(PatientId, MasterVisitId, EncounterType, ServiceAreaId, Convert.ToInt32(Session["AppUserId"]), visitDate);
                if (Result > 0)
                {
                    ResultOutcome.Result = MasterVisitId;
                    ResultOutcome.Msg    = EncounterType + " Encounter Saved";
                }
            }
            else
            {
                var lookupLogic = new LookupLogic();
                var facility    = lookupLogic.GetFacility(Session["AppPosID"].ToString());
                if (facility == null)
                {
                    facility = lookupLogic.GetFacility();
                }

                PatientMasterVisit pm = new PatientMasterVisit();
                pm.ServiceId  = 1;
                pm.VisitDate  = visitDate;
                pm.VisitBy    = UserId;
                pm.Start      = visitDate;
                pm.End        = visitDate;
                pm.PatientId  = PatientId;
                pm.CreatedBy  = UserId;
                pm.Active     = true;
                pm.Status     = 2;
                pm.FacilityId = facility.FacilityID;

                int PatientMasterVisitId = pmvManager.AddPatientMasterVisit(pm);

                int res = patientEncounter.SavePatientPreviousEncounter(PatientId, PatientMasterVisitId, EncounterType, ServiceAreaId, Convert.ToInt32(Session["AppUserId"]), visitDate);
                if (res > 0)
                {
                    Result = PatientMasterVisitId;
                    ResultOutcome.Result = Result;
                    ResultOutcome.Msg    = EncounterType + "Encounter Saved";
                }
            }
            string jsonScreeningObject = "[]";

            jsonScreeningObject = new JavaScriptSerializer().Serialize(ResultOutcome);
            return(jsonScreeningObject);
        }
示例#24
0
        public void savePatientEncounterChronicIllness(string chronicIllness, string vaccines, string allergies)
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            patientEncounter.savePatientEncounterChronicIllness(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString(), Session["AppUserId"].ToString(), chronicIllness, vaccines, allergies);
        }
示例#25
0
        public string getDrugFrequencyMultiplier(string freqID)
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            return(patientEncounter.getPharmacyDrugMultiplier(freqID));
        }
        private void loadPatientEncounter()
        {
            Entities.CCC.Encounter.PatientEncounter.PresentingComplaintsEntity pce = new Entities.CCC.Encounter.PatientEncounter.PresentingComplaintsEntity();
            pce = PEL.loadPatientEncounter(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            PatientAppointmentManager patientAppointmentManager = new PatientAppointmentManager();

            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable   theDT        = patientEncounter.loadPatientEncounterPhysicalExam(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            DataTable   theDTAdverse = patientEncounter.loadPatientEncounterAdverseEvents(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            bool        isOnEdit     = false;
            LookupLogic lookUp       = new LookupLogic();

            /////PRESENTING COMPLAINTS
            visitdateval = pce.visitDate;
            //if (pce.visitDate != "")
            //    visitdateval = pce.visitDate;
            //else
            //    visitdateval = "";

            LMPval        = pce.lmp;
            EDDval        = pce.edd;
            nxtAppDateval = pce.nextAppointmentDate;
            if (!String.IsNullOrWhiteSpace(pce.visitScheduled))
            {
                isOnEdit = true;
            }

            if (pce.visitScheduled == "1")
            {
                vsYes.Checked = true;
            }
            else if (pce.visitScheduled == "0")
            {
                vsNo.Checked = true;
            }

            //rblVisitScheduled.SelectedValue = pce.visitScheduled;
            ddlVisitBy.SelectedValue = pce.visitBy;

            if (pce.anyComplaint == "1")
            {
                rdAnyComplaintsYes.Checked = true;
            }
            else if (pce.anyComplaint == "0")
            {
                rdAnyComplaintsNo.Checked = true;
            }

            complaints.Value = pce.complaints;
            //ICF Updates
            //Tb outcome
            ddlOnAntiTBDrugs.SelectedValue = getSelectedValue(pce.OnAntiTB);
            //On IPT
            ddlICFCurrentlyOnIPT.SelectedValue = getSelectedValue(pce.OnIPT);
            //start IPT
            ddlICFStartIPT.SelectedValue = getSelectedValue(pce.EverBeenOnIPT);

            //Cough
            ddlICFCough.SelectedValue = getSelectedValue(pce.Cough);
            //fever
            ddlICFFever.SelectedValue = getSelectedValue(pce.Fever);
            //weight
            ddlICFWeight.SelectedValue = getSelectedValue(pce.NoticeableWeightLoss);
            //night sweats
            ddlICFNightSweats.SelectedValue = getSelectedValue(pce.NightSweats);

            //sputum
            ddlSputumSmear.SelectedValue = pce.SputumSmear;
            //gene expert
            ddlGeneXpert.SelectedValue = pce.geneXpert;
            //chest
            ddlChestXray.SelectedValue = pce.ChestXray;
            //anti tb
            ddlStartAntiTB.SelectedValue = getSelectedValue(pce.startAntiTB);
            //contacts invitatio
            ddlInvitationofContacts.SelectedValue = getSelectedValue(pce.InvitationOfContacts);
            //ipt evaluation
            ddlEvaluatedforIPT.SelectedValue = getSelectedValue(pce.EvaluatedForIPT);

            IptCw.IPTurineColour.SelectedValue         = pce.YellowColouredUrine;
            IptCw.IPTNumbness.SelectedValue            = pce.Numbness;
            IptCw.IPTYellowEyes.SelectedValue          = pce.YellownessOfEyes;
            IptCw.IPTAbdominalTenderness.SelectedValue = pce.AdominalTenderness;
            IptCw.IPTLiverTest.Text         = pce.LiverFunctionTests;
            IptCw.IPTStartIPT.SelectedValue = pce.startIPT;
            IptCw.StartDateIPT.Text         = pce.IPTStartDate;

            //tb outcome
            ddlICFTBScreeningOutcome.SelectedValue = pce.tbScreening;
            nutritionscreeningstatus.SelectedValue = pce.nutritionStatus;
            txtWorkPlan.Text = pce.WorkPlan;
            foreach (ListItem item in cblGeneralExamination.Items)
            {
                for (int i = 0; i < pce.generalExams.Length; i++)
                {
                    if (item.Value == pce.generalExams[i])
                    {
                        item.Selected = true;
                    }
                }
            }



            ////PATIENT MANAGEMENT
            foreach (ListItem item in cblPHDP.Items)
            {
                for (int i = 0; i < pce.phdp.Length; i++)
                {
                    if (item.Value == pce.phdp[i])
                    {
                        item.Selected = true;
                    }
                }
            }

            arvAdherance.SelectedValue = pce.ARVAdherence;
            ctxAdherance.SelectedValue = pce.CTXAdherence;
            if (pce.StabilityCategorization != null)
            {
                ((PatientCategorizationStatus)Convert.ToInt16(pce.StabilityCategorization)).ToString();
                var stabilityAsessment = ((PatientCategorizationStatus)Convert.ToInt16(pce.StabilityCategorization)).ToString();
                stabilityStatus.SelectedValue = stabilityStatus.Items.FindByText(stabilityAsessment).Value;
            }
            WHOStage.SelectedValue = pce.WhoStage;

            if (theDT.Rows.Count > 0 && isOnEdit)
            {
                systemsOkNo.Checked = true;
            }
            else if (theDT.Rows.Count == 0 && isOnEdit)
            {
                systemsOkYes.Checked = true;
            }

            if (theDTAdverse.Rows.Count > 0 && isOnEdit)
            {
                rdAnyAdverseEventsYes.Checked = true;
            }
            else if (theDTAdverse.Rows.Count == 0 && isOnEdit)
            {
                rdAnyAdverseEventsNo.Checked = true;
            }
            AppointmentId        = pce.appointmentId;
            AppointmentDate.Text = pce.nextAppointmentDate;

            NextAppointmentDate = Convert.ToDateTime(pce.nextAppointmentDate);
            //if (pce.nextAppointmentDate != "")
            //{
            //    if (pce.nextAppointmentDate != null)
            //        AppointmentDate.Text = DateTime.Parse(pce.nextAppointmentDate.Trim()).ToString("dd-MMM-yyyy", CultureInfo.InvariantCulture);
            //}
            ServiceArea.SelectedValue        = pce.appointmentServiceArea;
            Reason.SelectedValue             = pce.appointmentReason;
            DifferentiatedCare.SelectedValue = pce.nextAppointmentType;
            description.Text  = pce.appointmentDesc;
            IsEditAppointment = (pce.nextAppointmentType != null);
            // IsEditAppointmentId=(pce.)
            //status.SelectedValue = pce.appontmentStatus;
            if (IsEditAppointment)
            {
                if (!string.IsNullOrWhiteSpace(pce.nextAppointmentType))
                {
                    var app = patientAppointmentManager.GetByPatientId((int)Session["PatientPK"])
                              .Where(x => x.AppointmentDate == Convert.ToDateTime(pce.nextAppointmentDate)).ToList();
                    if (app != null)
                    {
                        IsEditAppointmentId = app[0].Id;
                    }
                }
            }

            //AppointmentDate.Text = pce.nextAppointmentDate.ToString();
            //ipt pop ups
            Page.ClientScript.RegisterStartupScript(this.GetType(), "tbInfectedYesNo", "tbInfectedChange();", true);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "IcfChange", "IcfChange();", true);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "IcfActionChange", "IcfActionChange();", true);
        }
示例#27
0
        public void savePatientManagement(string workplan, string phdp, string ARVAdherence, string CTXAdherence, string diagnosis)
        {
            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            patientEncounter.savePatientManagement(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString(), Session["AppUserId"].ToString(), workplan, ARVAdherence, CTXAdherence, phdp, diagnosis);
        }
示例#28
0
        public ArrayList GetAdverseEvents()
        {
            int adverseEventId       = 0;
            int patientId            = Convert.ToInt32(Session["PatientPK"].ToString());
            int patientMasterVisitId = Convert.ToInt32(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString());
            var outcomeString        = "";

            PatientEncounterLogic             patientEncounter           = new PatientEncounterLogic();
            PatientAdverseEventOutcomeManager patientAdverseEventOutcome = new PatientAdverseEventOutcomeManager();

            LookupLogic lookupLogic = new LookupLogic();


            DataTable theDT = patientEncounter.loadPatientEncounterAdverseEvents(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            ArrayList rows  = new ArrayList();

            foreach (DataRow row in theDT.Rows)
            {
                string   eventoutcome = "";
                DateTime outcomeDate  = DateTime.Today;

                //get the adverse Event form the db
                var items = lookupLogic.GetItemIdByGroupAndItemName("AdverseEvents", row["EventName"].ToString());
                foreach (var item in items)
                {
                    adverseEventId = item.ItemId;
                }

                // get the outcome for the adverse event
                // var outcome =patientAdverseEventOutcome.GetAdverseEventOutcome(adverseEventId, patientMasterVisitId, patientId);

                var adverseEventOutcomes = patientAdverseEventOutcome.GetAdverseEventOutcome(adverseEventId, patientMasterVisitId, patientId);



                if (adverseEventOutcomes.Count > 0)
                {
                    foreach (var adverseEventOutcome in adverseEventOutcomes)
                    {
                        eventoutcome = lookupLogic.GetLookupItemNameById(adverseEventOutcome.OutcomeId);
                        outcomeDate  = Convert.ToDateTime(adverseEventOutcome.OutcomeDate);
                    }
                    if (string.IsNullOrEmpty(eventoutcome))
                    {
                        string[] i = new string[7]
                        {
                            row["SeverityID"].ToString(), row["AdverseEventId"].ToString(), row["EventName"].ToString(), row["EventCause"].ToString(),
                            row["Severity"].ToString(), row["Action"].ToString(),
                            "<button type='button' class='btnAddAdverseEventOutcome btn btn-info fa fa-plus-circle btn-fill' onclick='AdverseEventOutcome();'> Specify Outcome</button> <button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>"
                        };
                        rows.Add(i);
                    }
                    else
                    {
                        if (eventoutcome == "Died")
                        {
                            outcomeString = "<span class='text-danger'><strong>" + eventoutcome +
                                            "</strong></span> | <span class='text-info'><strong>" + outcomeDate.ToString("dd-MMM-yyy") + "</strong></span>";
                        }
                        else
                        {
                            outcomeString = "<span class='text-primary'><strong>" + eventoutcome +
                                            "</strong></span> | <span class='text-info'><strong>" + outcomeDate.ToString("dd-MMM-yyy") + "</strong></span>";
                        }
                        string[] i = new string[6]
                        {
                            row["SeverityID"].ToString(),
                            row["EventName"].ToString(),
                            row["EventCause"].ToString(),
                            row["Severity"].ToString(),
                            row["Action"].ToString(),
                            outcomeString
                            //"<span class='text-info'>outcome:</span>"+eventoutcome+ "<span class='text-info'>outcome Date:</span>"+ outcomeDate
                        };
                        rows.Add(i);
                    }
                }
                else
                {
                    string[] i = new string[7]
                    {
                        row["SeverityID"].ToString(), row["AdverseEventId"].ToString(), row["EventName"].ToString(), row["EventCause"].ToString(),
                        row["Severity"].ToString(), row["Action"].ToString(),
                        "<button type='button' class='btnAddAdverseEventOutcome btn btn-info fa fa-plus-circle btn-fill' onclick='AdverseEventOutcome();'> Specify Outcome</button> <button type='button' class='btnDelete btn btn-danger fa fa-minus-circle btn-fill' > Remove</button>"
                    };
                    rows.Add(i);
                }
            }
            return(rows);
        }
        private void loadPatientEncounter()
        {
            Entities.CCC.Encounter.PatientEncounter.PresentingComplaintsEntity pce = new Entities.CCC.Encounter.PatientEncounter.PresentingComplaintsEntity();
            pce = PEL.loadPatientEncounter(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());

            PatientEncounterLogic patientEncounter = new PatientEncounterLogic();

            DataTable theDT        = patientEncounter.loadPatientEncounterPhysicalExam(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            DataTable theDTAdverse = patientEncounter.loadPatientEncounterAdverseEvents(Session["ExistingRecordPatientMasterVisitID"].ToString() == "0" ? Session["PatientMasterVisitID"].ToString() : Session["ExistingRecordPatientMasterVisitID"].ToString(), Session["PatientPK"].ToString());
            bool      isOnEdit     = false;

            /////PRESENTING COMPLAINTS
            visitdateval = pce.visitDate;
            //if (pce.visitDate != "")
            //    visitdateval = pce.visitDate;
            //else
            //    visitdateval = "";

            LMPval        = pce.lmp;
            EDDval        = pce.edd;
            nxtAppDateval = pce.nextAppointmentDate;
            if (!String.IsNullOrWhiteSpace(pce.visitScheduled))
            {
                isOnEdit = true;
            }

            if (pce.visitScheduled == "1")
            {
                vsYes.Checked = true;
            }
            else if (pce.visitScheduled == "0")
            {
                vsNo.Checked = true;
            }

            //rblVisitScheduled.SelectedValue = pce.visitScheduled;
            ddlVisitBy.SelectedValue = pce.visitBy;

            if (pce.anyComplaint == "1")
            {
                rdAnyComplaintsYes.Checked = true;
            }
            else if (pce.anyComplaint == "0")
            {
                rdAnyComplaintsNo.Checked = true;
            }

            complaints.Value            = pce.complaints;
            tbInfected.SelectedValue    = pce.OnAntiTB;
            onIpt.SelectedValue         = pce.OnIPT;
            EverBeenOnIpt.SelectedValue = pce.EverBeenOnIPT;

            cough.SelectedValue       = pce.Cough;
            fever.SelectedValue       = pce.Fever;
            weightLoss.SelectedValue  = pce.NoticeableWeightLoss;
            nightSweats.SelectedValue = pce.NightSweats;

            sputum.SelectedValue             = pce.SputumSmear;
            geneXpert.SelectedValue          = pce.geneXpert;
            chest.SelectedValue              = pce.ChestXray;
            antiTb.SelectedValue             = pce.startAntiTB;
            contactsInvitation.SelectedValue = pce.InvitationOfContacts;
            iptEvaluation.SelectedValue      = pce.EvaluatedForIPT;

            IptCw.IPTurineColour.SelectedValue         = pce.YellowColouredUrine;
            IptCw.IPTNumbness.SelectedValue            = pce.Numbness;
            IptCw.IPTYellowEyes.SelectedValue          = pce.YellownessOfEyes;
            IptCw.IPTAbdominalTenderness.SelectedValue = pce.AdominalTenderness;
            IptCw.IPTLiverTest.Text         = pce.LiverFunctionTests;
            IptCw.IPTStartIPT.SelectedValue = pce.startIPT;
            IptCw.StartDateIPT.Text         = pce.IPTStartDate;


            tbscreeningstatus.SelectedValue        = pce.tbScreening;
            nutritionscreeningstatus.SelectedValue = pce.nutritionStatus;
            txtWorkPlan.Text = pce.WorkPlan;
            foreach (ListItem item in cblGeneralExamination.Items)
            {
                for (int i = 0; i < pce.generalExams.Length; i++)
                {
                    if (item.Value == pce.generalExams[i])
                    {
                        item.Selected = true;
                    }
                }
            }



            ////PATIENT MANAGEMENT
            foreach (ListItem item in cblPHDP.Items)
            {
                for (int i = 0; i < pce.phdp.Length; i++)
                {
                    if (item.Value == pce.phdp[i])
                    {
                        item.Selected = true;
                    }
                }
            }

            arvAdherance.SelectedValue = pce.ARVAdherence;
            ctxAdherance.SelectedValue = pce.CTXAdherence;
            WHOStage.SelectedValue     = pce.WhoStage;

            if (theDT.Rows.Count > 0 && isOnEdit)
            {
                systemsOkNo.Checked = true;
            }
            else if (theDT.Rows.Count == 0 && isOnEdit)
            {
                systemsOkYes.Checked = true;
            }

            if (theDTAdverse.Rows.Count > 0 && isOnEdit)
            {
                rdAnyAdverseEventsYes.Checked = true;
            }
            else if (theDTAdverse.Rows.Count == 0 && isOnEdit)
            {
                rdAnyAdverseEventsNo.Checked = true;
            }

            AppointmentDate.Text = pce.nextAppointmentDate;
            //if (pce.nextAppointmentDate != "")
            //{
            //    if (pce.nextAppointmentDate != null)
            //        AppointmentDate.Text = DateTime.Parse(pce.nextAppointmentDate.Trim()).ToString("dd-MMM-yyyy", CultureInfo.InvariantCulture);
            //}
            ServiceArea.SelectedValue        = pce.appointmentServiceArea;
            Reason.SelectedValue             = pce.appointmentReason;
            DifferentiatedCare.SelectedValue = pce.nextAppointmentType;
            description.Text = pce.appointmentDesc;
            //status.SelectedValue = pce.appontmentStatus;

            //ipt pop ups
            Page.ClientScript.RegisterStartupScript(this.GetType(), "tbInfectedYesNo", "tbInfectedChange();", true);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "IcfChange", "IcfChange();", true);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "IcfActionChange", "IcfActionChange();", true);
        }