public void LoadMedicalData()
    {
        DeadMedicalInfo deadMedical = new DeadMedicalInfo();
        deadMedical.Where.DeadEventID.Value = ParmDeadEventID;
        deadMedical.Where.DeadEventID.Operator = MyGeneration.dOOdads.WhereParameter.Operand.Equal;
        deadMedical.Query.Load();

        //ICDCODE9000 objICD9000 = new ICDCODE9000();
        ICD10_DirectDeathReason objICD9000 = new ICD10_DirectDeathReason();
        ucItemControlDeathReasonA.setCode = objICD9000.getICD9000Description(deadMedical.CauseOfDeathA);
        //deadMedical.CauseOfDeathA = ucItemControlDeathReasonA.SelectedICD;
        ucItemControlDeathReasonA.Days = deadMedical.CauseOfDeathAPeriod.Substring(0, 2);
        ucItemControlDeathReasonA.Months = deadMedical.CauseOfDeathAPeriod.Substring(2, 2);
        ucItemControlDeathReasonA.Years = deadMedical.CauseOfDeathAPeriod.Substring(4, 2);

        //ucItemControlDeathReasonB.setCode = objICD9000.getICD9000Description(deadMedical.CauseOfDeathB);
        //ucItemControlDeathReasonC.setCode = objICD9000.getICD9000Description(deadMedical.CauseOfDeathC);
        ucItemControlDeathReasonD.setCode = objICD9000.getICD9000Description(deadMedical.CauseOfDeathD);

        /*
        //deadMedical.CauseOfDeathAPeriod = ucItemControlDeathReasonA.Days + ucItemControlDeathReasonA.Months + ucItemControlDeathReasonA.Years;
        if (deadMedical.CauseOfDeathB != null && deadMedical.CauseOfDeathB != 0)
            lblSelectedItem.Text = new ICD10ITEM().getItemDescription(deadMedical.CauseOfDeathB);
        //deadMedical.CauseOfDeathB = int.Parse(dropICDItem.SelectedValue);
        if (deadMedical.CauseOfDeathC != "")
            lblSelectedCode.Text = new ICD10CODE().getCodeDescription(deadMedical.CauseOfDeathC);
        //deadMedical.CauseOfDeathC = dropICDcode.SelectedValue;

        if (deadMedical.CauseOfDeathD != "")
            ucItemControlDeathReasonD.setCode = objICD9000.getICD9000Description(deadMedical.CauseOfDeathD);
        //deadMedical.CauseOfDeathD = ucItemControlDeathReasonD.SelectedICD;
        if (deadMedical.CauseOfDeathDPeriod != "000000")
        {
            //deadMedical.CauseOfDeathDPeriod = ucItemControlDeathReasonD.Days + ucItemControlDeathReasonD.Months + ucItemControlDeathReasonD.Years;
            ucItemControlDeathReasonD.Days = deadMedical.CauseOfDeathDPeriod.Substring(0, 2);
            ucItemControlDeathReasonD.Months = deadMedical.CauseOfDeathDPeriod.Substring(2, 2);
            ucItemControlDeathReasonD.Years = deadMedical.CauseOfDeathDPeriod.Substring(4, 2);
        }
        */
        if (deadMedical.CauseOfDeathNotRelatedA != "")
            ucItemCauseOfDeathNotRelatedA.setCode = objICD9000.getICD9000Description(deadMedical.CauseOfDeathNotRelatedA);
        //deadMedical.CauseOfDeathNotRelatedA = ucItemCauseOfDeathNotRelatedA.SelectedICD;
        if (deadMedical.CauseOfDeathNotRelatedAPeriod != "000000")
        {
            // deadMedical.CauseOfDeathNotRelatedAPeriod = ucItemCauseOfDeathNotRelatedA.Days + ucItemCauseOfDeathNotRelatedA.Months + ucItemCauseOfDeathNotRelatedA.Years;
            ucItemCauseOfDeathNotRelatedA.Days = deadMedical.CauseOfDeathNotRelatedAPeriod.Substring(0, 2);
            ucItemCauseOfDeathNotRelatedA.Months = deadMedical.CauseOfDeathNotRelatedAPeriod.Substring(2, 2);
            ucItemCauseOfDeathNotRelatedA.Years = deadMedical.CauseOfDeathNotRelatedAPeriod.Substring(4, 2);
        }

        if (deadMedical.CauseOfDeathNotRelatedB != "")
            ucItemCauseOfDeathNotRelatedB.setCode = objICD9000.getICD9000Description(deadMedical.CauseOfDeathNotRelatedB);
        // deadMedical.CauseOfDeathNotRelatedB = ucItemCauseOfDeathNotRelatedB.SelectedICD;
        if (deadMedical.CauseOfDeathNotRelatedBPeriod != "000000")
        {
            //deadMedical.CauseOfDeathNotRelatedBPeriod = ucItemCauseOfDeathNotRelatedB.Days + ucItemCauseOfDeathNotRelatedB.Months + ucItemCauseOfDeathNotRelatedB.Years;
            ucItemCauseOfDeathNotRelatedB.Days = deadMedical.CauseOfDeathNotRelatedBPeriod.Substring(0, 2);
            ucItemCauseOfDeathNotRelatedB.Months = deadMedical.CauseOfDeathNotRelatedBPeriod.Substring(2, 2);
            ucItemCauseOfDeathNotRelatedB.Years = deadMedical.CauseOfDeathNotRelatedBPeriod.Substring(4, 2);
        }

        if (deadMedical.IsSmoker)
            radioListISSmoker.SelectedIndex = 0;
        else
            radioListISSmoker.SelectedIndex = 1;
        //deadMedical.IsSmoker = radioListISSmoker.SelectedValue == "1" ? true : false;
        radioListSmokingType.SelectedIndex = radioListSmokingType.Items.IndexOf(radioListSmokingType.Items.FindByValue(deadMedical.SmokeType));
        //deadMedical.SmokeType = radioListSmokingType.SelectedValue;
        txtsmokingPeriod1.Text = deadMedical.SmokePeriod.Substring(0, 2);
        txtsmokingPeriod2.Text = deadMedical.SmokePeriod.Substring(2, 2);
        //  deadMedical.SmokePeriod = (txtsmokingPeriod1.Text.Length == 1 ? "0" + txtsmokingPeriod1.Text : txtsmokingPeriod1.Text) +
        //                           (txtsmokingPeriod2.Text.Length == 1 ? "0" + txtsmokingPeriod2.Text : txtsmokingPeriod2.Text);

        if (deadMedical.IsCausedByAccedent)
            rdCauseByAccedenc.SelectedIndex = 0;
        else
            rdCauseByAccedenc.SelectedIndex = 1;

        drpReason.SelectedIndex = drpReason.Items.IndexOf(drpReason.Items.FindByValue(deadMedical.AccedentCause.ToString()));
        //deadMedical.AccedentCause = int.Parse(drpReason.SelectedValue);
        txtAccidentLocation.Text = deadMedical.AccedentPlace;
        txtAnotherReason.Text = deadMedical.AccedentAnotherCause;
        //deadMedical.AccedentPlace = txtAccidentLocation.Text;
        dropCarType.SelectedIndex = dropCarType.Items.IndexOf(dropCarType.Items.FindByValue(deadMedical.VehicleType.ToString()));
        //deadMedical.VehicleType = int.Parse(dropCarType.SelectedValue);
        txtCarType.Text = deadMedical.VehicleTypeOther;
        //deadMedical.VehicleTypeOther = txtCarType.Text;
        RdDeadPersonType.SelectedIndex = RdDeadPersonType.Items.IndexOf(RdDeadPersonType.Items.FindByValue(deadMedical.DeadStatus.ToString()));
        //deadMedical.DeadStatus = int.Parse(RdDeadPersonType.SelectedValue);

        if (deadMedical.HasTumor)
            rdTumorFlag.SelectedIndex = 0;
        else
            rdTumorFlag.SelectedIndex = 1;
        txtTumorLocation.Text = deadMedical.PlaceOfTumor;
        dropTumorType.SelectedIndex = dropTumorType.Items.IndexOf(dropTumorType.Items.FindByValue(deadMedical.TypeOfTumor.ToString()));
        //deadMedical.TypeOfTumor = int.Parse(dropTumorType.SelectedValue);
        dropTumorPhases.SelectedIndex = dropTumorPhases.Items.IndexOf(dropTumorPhases.Items.FindByValue(deadMedical.PhaseOfTumor.ToString()));
        // deadMedical.PhaseOfTumor = int.Parse(dropTumorPhases.SelectedValue);

        if (deadMedical.DeadThroghCarry)
            rdDeathThroughCarry.SelectedIndex = 0;
        else
            rdDeathThroughCarry.SelectedIndex = 1;

        //deadMedical.DeadThroghCarry = rdDeathThroughCarry.SelectedValue == "1" ? true : false;
        if (deadMedical.DeadThroghBirth)
            rdDeadThroughBirth.SelectedIndex = 0;
        else
            rdDeadThroughBirth.SelectedIndex = 1;

        //deadMedical.DeadThroghBirth = rdAbortionPast6Weeks.SelectedValue == "1" ? true : false;
        if (deadMedical.AbortionPast6Weeks)
            rdAbortionPast6Weeks.SelectedIndex = 0;
        else
            rdAbortionPast6Weeks.SelectedIndex = 1;

        //deadMedical.AbortionPast6Weeks = rdAbortionPast6Weeks.SelectedValue == "1" ? true : false;
        if (deadMedical.BirthPast6Weeks)
            rdBirthPast6Weeks.SelectedIndex = 0;
        else
            rdBirthPast6Weeks.SelectedIndex = 1;
        // deadMedical.DeadThroghBirth = rdDeadThroughBirth.SelectedValue == "1" ? true : false;
        //deadMedical.BirthPast6Weeks = rdBirthPast6Weeks.SelectedValue == "1" ? true : false;

        try
        {
            txtDate.Text = deadMedical.BirthDate.ToString();
        }
        catch
        {
            //continue
        }
        //IFormatProvider culture = new CultureInfo("en-US", true);
        //deadMedical.BirthDate = DateTime.ParseExact(txtDate.Text, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);
        dropBirthOuput.SelectedIndex = dropBirthOuput.Items.IndexOf(dropBirthOuput.Items.FindByValue(deadMedical.BirthResult.ToString()));
        //deadMedical.BirthResult = int.Parse(dropBirthOuput.SelectedValue);
        txtBirthLocation.Text = deadMedical.BirthPlace;
        txtBirthOperator.Text = deadMedical.BirthOperator;
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        lblSelectedICD.Text = "";
        //ICDCODE9000 objICD = new ICDCODE9000();
        ICD10_DirectDeathReason objICD = new ICD10_DirectDeathReason();
        if (txtSearch.Text != "")
        {
            DataTable dt = objICD.FilterICDcodes(txtSearch.Text.Trim());

            if (dt.Rows.Count > 0)
            {
                dropItem.DataSource = dt.DefaultView;
                //dropItem.DataTextField = ICDCODE9000.ColumnNames.DESCRENG;
                //dropItem.DataValueField = ICDCODE9000.ColumnNames.CODE;
                dropItem.DataTextField = ICD10_DirectDeathReason.ColumnNames.DiagnosisEDesc;
                dropItem.DataValueField = ICD10_DirectDeathReason.ColumnNames.DiagnosisCode;
                dropItem.DataBind();

                ListItem item = new ListItem(" ", "0");
                dropItem.Items.Insert(0, item);
                dropItem.SelectedIndex = 0;
            }
            else
            {
                dropItem.Items.Clear();
                dropItem.DataSource = null;
                dropItem.DataBind();
            }
        }
        else
        {
            dropItem.Items.Clear();
            dropItem.DataSource = null;
            dropItem.DataBind();
        }
    }