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); }
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); }