Example #1
0
        void ComputeConsolidateDiagnosis()
        {
            DiagnosisStructure dsL = new DiagnosisStructure();

            foreach (var item in this.leftEye_flp.Controls)
            {
                DiagnosisUC c = item as DiagnosisUC;
                dsL.DiagnosisList.Add(c.GetDiagnosis());
            }
            //ConsolidatedDiagnosisLeft = JsonConvert.SerializeObject(dsL);
            ConsolidatedDiagnosisLeft  = string.Empty;
            ConsolidatedDiagnosisRight = string.Empty;
            for (int i = 0; i < dsL.DiagnosisList.Count; i++)
            {
                ConsolidatedDiagnosisLeft += dsL.DiagnosisList[i] + ",";
            }
            ConsolidatedDiagnosisLeft = ConsolidatedDiagnosisLeft.TrimEnd(',');
            DiagnosisStructure dsR = new DiagnosisStructure();

            foreach (var item in this.rightEye_flp.Controls)
            {
                DiagnosisUC c = item as DiagnosisUC;
                dsR.DiagnosisList.Add(c.GetDiagnosis());
            }
            //ConsolidatedDiagnosisRight = JsonConvert.SerializeObject(dsR);
            for (int i = 0; i < dsR.DiagnosisList.Count; i++)
            {
                ConsolidatedDiagnosisRight += dsR.DiagnosisList[i] + ",";
            }
            ConsolidatedDiagnosisRight = ConsolidatedDiagnosisRight.TrimEnd(',');
        }
Example #2
0
 private void GetDiagnosis()
 {
     //ComputeConsolidateDiagnosis();
     this.leftEye_flp.Controls.Clear();
     this.rightEye_flp.Controls.Clear();
     NewDataVariables.PatientDiagnosis = NewDataVariables.PatientDiagnosis.Where(x => x.voided == false).ToList();
     if (NewDataVariables.PatientDiagnosis != null && NewDataVariables.PatientDiagnosis.Count > 0)
     {
         string             leftDiagnosis = string.Empty;
         DiagnosisStructure dL            = new DiagnosisStructure();
         for (int i = 0; i < NewDataVariables.PatientDiagnosis.Count; i++)
         {
             leftDiagnosis = NewDataVariables.PatientDiagnosis[i].diagnosisValueLeft;
             //dL = (DiagnosisStructure)Newtonsoft.Json.JsonConvert.DeserializeObject(leftDiagnosis, typeof(DiagnosisStructure));
             if (!string.IsNullOrEmpty(leftDiagnosis))
             {
                 dL.DiagnosisList = leftDiagnosis.Split(',').ToList();
                 for (int j = 0; j < dL.DiagnosisList.Count; j++)
                 {
                     //DiagnosisUC l = new DiagnosisUC(dL.DiagnosisList[j]);
                     //l.RemoveDiagnosisEvent += l_RemoveDiagnosisEvent;
                     ////l.Text = dL.DiagnosisList[j];
                     //l.AutoSize = false;
                     ////l.AutoEllipsis = true;
                     //leftEye_flp.Controls.Add(l);
                     diagnosis = dL.DiagnosisList[j];
                     AddDiagnosis(PopulateDiagnosis.FromDB, DiagnosisSide.Left);
                 }
             }
         }
         string             rightDiagnosis = string.Empty;
         DiagnosisStructure dR             = new DiagnosisStructure();
         for (int i = 0; i < NewDataVariables.PatientDiagnosis.Count; i++)
         {
             rightDiagnosis = NewDataVariables.PatientDiagnosis[i].diagnosisValueRight;
             //dR = (DiagnosisStructure)Newtonsoft.Json.JsonConvert.DeserializeObject(rightDiagnosis, typeof(DiagnosisStructure));
             if (!string.IsNullOrEmpty(rightDiagnosis))
             {
                 dR.DiagnosisList = rightDiagnosis.Split(',').ToList();
                 for (int j = 0; j < dR.DiagnosisList.Count; j++)
                 {
                     //DiagnosisUC l = new DiagnosisUC(dR.DiagnosisList[j]);
                     //l.RemoveDiagnosisEvent += r_RemoveDiagnosisEvent;
                     ////l.Text = dR.DiagnosisList[j];
                     //l.AutoSize = false;
                     ////l.AutoEllipsis = true;
                     //rightEye_flp.Controls.Add(l);
                     diagnosis = dR.DiagnosisList[j];
                     AddDiagnosis(PopulateDiagnosis.FromDB, DiagnosisSide.Right);
                 }
             }
         }
     }
 }
Example #3
0
        /// <summary>
        /// This method will set the active patient details into the labels text.
        /// </summary>
        public void setPatValues()
        {
            try
            {
                if (NewDataVariables.Patients.Count != 0)
                {
                    currentPat = NewDataVariables.Patients.Where(x => x.personId == NewDataVariables.Active_Patient).ToList()[0];
                    //PatEditMrn_lbl.Text = NewDataVariables.Active_PatientIdentifier.value;
                    PatEditMrn_lbl.Text       = currentPat.identifiers.ToList()[0].value;
                    PatEditFirstName_lbl.Text = currentPat.firstName;
                    PatEditLastName_lbl.Text  = currentPat.lastName;
                    #region 0001699 if the user setting value of isAgeSelect is true it will diaplay age else to show date of birth
                    if (Convert.ToBoolean(IVLVariables.CurrentSettings.UserSettings._IsAgeSelect.val))
                    {
                        age_lbl.Text = IVLVariables.LangResourceManager.GetString("PatientDetailsAge_Label_Text", IVLVariables.LangResourceCultureInfo);;

                        PatAge_lbl.Text = (DateTime.Now.Year - currentPat.birthdate.Year).ToString();
                    }
                    else
                    {
                        PatAge_lbl.Text = currentPat.birthdate.ToString("dd/MM/yyyy");
                        age_lbl.Text    = IVLVariables.LangResourceManager.GetString("dob_radio_button_Text", IVLVariables.LangResourceCultureInfo) + " :";
                    }
                    #endregion
                    string gen;
                    if (currentPat.gender == 'M')
                    {
                        gen = "Male";
                    }
                    else
                    {
                        gen = "Female";
                    }
                    PatEditGender_lbl.Text = gen;
                    //if (NewDataVariables.Active_Patient.primaryPhoneNumber != null)
                    //    PatEditMobile_lbl.Text = NewDataVariables.Active_Patient.primaryPhoneNumber.ToString();
                    //else
                    //    PatEditMobile_lbl.Text = "0";
                    List <person_attribute> attributes = currentPat.attributes.ToList();
                    //attributes = NewDataVariables._Repo.GetByCategory<person_attribute>("person", NewDataVariables.Patients.Where(x => x.personId == NewDataVariables.Active_Patient).ToList()[0]).ToList();
                    //if (NewDataVariables.Active_Patient.primaryEmailId != null)
                    //    PatEmail_lbl.Text = NewDataVariables.Active_Patient.primaryEmailId;
                    //else
                    //    PatEmail_lbl.Text = IVLVariables.LangResourceManager.GetString("NotMentioned_Text", IVLVariables.LangResourceCultureInfo);
                    foreach (person_attribute item in attributes)//This for loop has been added to display the patient attributes.
                    {
                        if (item.attributeType.personAttributeTypeId == (int)PatientAttributesType.Income)
                        {
                            //if (item.value != null)
                            //    PatEditIncome_lbl.Text = item.value;
                            //else
                            //    PatEditIncome_lbl.Text = (INTUSOFT.Data.Common.GetDescription(SalaryEnum.No_Salary));
                        }
                        else if (item.attributeType.personAttributeTypeId == (int)PatientAttributesType.Occupation)
                        {
                            //if (item.value != null)
                            //    PatOccupation_lbl.Text = item.value;
                            //else
                            //    PatOccupation_lbl.Text = (INTUSOFT.Data.Common.GetDescription(OccupationEnum.Occupation_Not_Selected));
                        }
                        else if (item.attributeType.personAttributeTypeId == (int)PatientAttributesType.Height)
                        {
                            //if (item.value != null)
                            //Patheight_lbl.Text = item.value;
                            //else
                            //Patheight_lbl.Text = "1";
                        }
                        else if (item.attributeType.personAttributeTypeId == (int)PatientAttributesType.Weight)
                        {
                            //if (item.value != null)
                            //    Patweight_lbl.Text = item.value;
                            //else
                            //    Patweight_lbl.Text = "1";
                        }
                        else if (item.attributeType.personAttributeTypeId == (int)PatientAttributesType.Comments)
                        {
                            if (item.value != null)
                            {
                                PatEditComments_lbl.Text = item.value.Replace("\n", "");// Replacing \n with space to avoid truncation of the comments data to fix defect 0001485
                            }
                            else
                            {
                                PatEditComments_lbl.Text = IVLVariables.LangResourceManager.GetString("NotMentioned_Text", IVLVariables.LangResourceCultureInfo);
                            }
                        }
                        else if (item.attributeType.personAttributeTypeId == (int)PatientAttributesType.Landline)
                        {
                            if (item.value != null)
                            {
                                //string phone = item.value;

                                //string[] stdcodeandPhone = phone.Split(' ');
                                //if (stdcodeandPhone[1] != null)
                                //    PatEditLandLine_lbl.Text = stdcodeandPhone[1].ToString();
                                //else
                                //    PatEditLandLine_lbl.Text = "0";
                                //if (stdcodeandPhone[0] != null)
                                //    PatEditStdCode_lbl.Text = stdcodeandPhone[0].ToString();
                                //else
                                //    PatEditStdCode_lbl.Text = "0";
                            }
                            else
                            {
                                //PatEditStdCode_lbl.Text = "0";
                                //PatEditLandLine_lbl.Text = "0";
                            }
                        }
                    }
                    //String s = NewDataVariables.Active_PersonAddressModel.cityVillage;
                    List <PersonAddressModel> perAddresses = currentPat.addresses.ToList();
                    String s = perAddresses[0].cityVillage;
                    //This below block of code has been added to display the address of the patient
                    {
                        if (s != null)
                        {
                            Patcity_lbl.Text = s;
                        }
                        else
                        {
                            Patcity_lbl.Text = INTUSOFT.Data.Common.GetDescription(CityEnum.City_Not_Selected);
                        }
                        String strst = perAddresses[0].stateProvince;
                        if (strst != null)
                        {
                            Patstate_lbl.Text = strst;
                        }
                        else
                        {
                            Patstate_lbl.Text = INTUSOFT.Data.Common.GetDescription(StateEnum.State_Not_Selected);
                        }
                        if (perAddresses[0].country != null)
                        {
                            Patcountry_lbl.Text = perAddresses[0].country;
                        }
                        else
                        {
                            Patcountry_lbl.Text = INTUSOFT.Data.Common.GetDescription(CountryEnum.Country_Not_Selected);
                        }
                        long pincode = Convert.ToInt64(perAddresses[0].postalCode);
                        Patpincode_lbl.Text = pincode.ToString();
                        if (perAddresses[0].line1 != null)
                        {
                            if (perAddresses[0].line1.Contains('_'))
                            {
                                string[] address = perAddresses[0].line1.Split('_');
                                PatEditDoorStreet_lbl.Text = address[0];
                                if (address.Length == 2)
                                {
                                    PatEditAddressArea_lbl.Text = address[1];
                                }
                            }
                            else
                            {
                                if (perAddresses[0].line1 != null)
                                {
                                    PatEditDoorStreet_lbl.Text = perAddresses[0].line1;
                                    if (perAddresses[0].line2 != null)
                                    {
                                        PatEditAddressArea_lbl.Text = perAddresses[0].line2;
                                    }
                                    else
                                    {
                                        PatEditAddressArea_lbl.Text = "";
                                    }
                                }
                                else
                                {
                                    PatEditDoorStreet_lbl.Text  = IVLVariables.LangResourceManager.GetString("NotMentioned_Text", IVLVariables.LangResourceCultureInfo);
                                    PatEditAddressArea_lbl.Text = "";
                                }
                            }
                        }
                        else
                        {
                            PatEditDoorStreet_lbl.Text  = IVLVariables.LangResourceManager.GetString("NotMentioned_Text", IVLVariables.LangResourceCultureInfo);
                            PatEditAddressArea_lbl.Text = "";
                        }
                    }
                    char[] a = { '.', '0' };
                    //PatreferredBy_lbl.Text = NewDataVariables.Active_Patient.referred_by.first_name;
                    if (currentPat.referredBy != null)
                    {
                        PatreferredBy_lbl.Text = currentPat.referredBy.firstName;
                    }
                    else
                    {
                        PatreferredBy_lbl.Text = IVLVariables.LangResourceManager.GetString("NotMentioned_Text", IVLVariables.LangResourceCultureInfo);
                    }
                    if (currentPat.historyAilments != null)
                    {
                        PathealthStatus_lbl.Text = currentPat.historyAilments;
                    }
                    else
                    {
                        PathealthStatus_lbl.Text = IVLVariables.LangResourceManager.GetString("NotMentioned_Text", IVLVariables.LangResourceCultureInfo);
                    }

                    #region The flowLayput for left and right diagnosis are cleared  from previous details in order fix defect 0001782
                    leftDiagnosis_flp.Controls.Clear();
                    rightDiagnosis_flp.Controls.Clear();
                    #endregion
                    List <PatientDiagnosis> patDiagnosis = currentPat.diagnosis.Where(x => x.voided == false).ToList();
                    if (patDiagnosis.Count > 0)
                    {
                        string             leftDiagnosis  = string.Empty;
                        string             rightDiagnosis = string.Empty;
                        DiagnosisStructure dR             = new DiagnosisStructure();
                        DiagnosisStructure dL             = new DiagnosisStructure();
                        for (int i = 0; i < patDiagnosis.Count; i++)
                        {
                            leftDiagnosis  = patDiagnosis[i].diagnosisValueRight;
                            rightDiagnosis = patDiagnosis[i].diagnosisValueLeft;
                            //dL = (DiagnosisStructure)Newtonsoft.Json.JsonConvert.DeserializeObject(leftDiagnosis, typeof(DiagnosisStructure));
                            dL.DiagnosisList.AddRange(leftDiagnosis.Split(',').ToList());
                            dR.DiagnosisList.AddRange(rightDiagnosis.Split(',').ToList());
                        }
                        dL.DiagnosisList = dL.DiagnosisList.Distinct().ToList();
                        dR.DiagnosisList = dR.DiagnosisList.Distinct().ToList();
                        for (int i = 0; i < dL.DiagnosisList.Count; i++)
                        {
                            Label l = new Label();
                            l.Text         = dL.DiagnosisList[i];
                            l.AutoSize     = false;
                            l.AutoEllipsis = true;
                            leftDiagnosis_flp.Controls.Add(l);
                        }
                        for (int i = 0; i < dR.DiagnosisList.Count; i++)
                        {
                            Label r = new Label();
                            r.Text         = dR.DiagnosisList[i];
                            r.AutoSize     = false;
                            r.AutoEllipsis = true;
                            rightDiagnosis_flp.Controls.Add(r);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Common.ExceptionLogWriter.WriteLog(ex, ExceptionLog);
//                ExceptionLog.Debug(IVLVariables.ExceptionLog.ConvertException2String(ex));
            }
        }