Пример #1
0
    /// <summary>
    /// This function added by Rakesh to merge ASAM pop up data in parent screen dataset
    /// </summary>
    private void MergeASAMPopUpDataInDataSet()
    {
        string       AutoSaveXML = GetRequestParameterValue("ASAMPopUpData").Replace("%PL", "+");
        StringReader stringReader;
        DataSet      datasetXMLReader = null;
        string       strxml           = AutoSaveXML.Replace("xmlns=\"\"", "");

        if (strxml.IndexOf("xmlns:xsi=") == -1)
        {
            int index = strxml.IndexOf("xmlns");
            if (index != -1)
            {
                strxml = strxml.Insert(index - 1, " " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" + " ");
            }
        }
        if (!string.IsNullOrEmpty(strxml))
        {
            stringReader     = new StringReader(strxml);
            datasetXMLReader = new DataSet();
            datasetXMLReader.ReadXml(stringReader);
        }
        if (BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.GetScreenInfoDataSet(), "CustomASAMPlacements"))
        {
            BaseCommonFunctions.GetScreenInfoDataSet().Tables["CustomASAMPlacements"].Merge(datasetXMLReader.Tables[0], false, MissingSchemaAction.Ignore);
        }
    }
Пример #2
0
        public override void BindControls()
        {
            DataSet dsHealthHomeDocuments = new DataSet();

            dsHealthHomeDocuments = BaseCommonFunctions.GetScreenInfoDataSet();
            DynamicFormsDiagnosticRiskAssessment.FormId = 95;
            DynamicFormsDiagnosticRiskAssessment.Activate();
            CustomGrid_CustomDocumentHealthHomeCarePlanDiagnoses.Bind(10977);
            CustomGrid_CustomDocumentHealthHomeCarePlanPESNeeds.Bind(ParentDetailPageObject.ScreenId);
            using (DataView DataViewGlobalCodes = BaseCommonFunctions.FillDropDown("XDIAGNOSISSOURCE", true, "", "", false))
            {
                if (DataViewGlobalCodes != null)
                {
                    DataViewGlobalCodes.Sort = "SortOrder asc";
                    DropDownList_CustomDocumentHealthHomeCarePlanDiagnoses_DiagnosisSource.DataTextField  = "CodeName";
                    DropDownList_CustomDocumentHealthHomeCarePlanDiagnoses_DiagnosisSource.DataValueField = "GlobalCodeID";
                    DropDownList_CustomDocumentHealthHomeCarePlanDiagnoses_DiagnosisSource.DataSource     = DataViewGlobalCodes;
                    DropDownList_CustomDocumentHealthHomeCarePlanDiagnoses_DiagnosisSource.DataBind();
                    DropDownList_CustomDocumentHealthHomeCarePlanDiagnoses_DiagnosisSource.Items.Insert(0, new ListItem("", "0"));
                }
            }
            using (DataView DataViewGlobalCodes = BaseCommonFunctions.FillDropDown("XICPNEEDS", true, "", "", false))
            {
                DataViewGlobalCodes.Sort = "SortOrder asc";
                DropDownList_CustomDocumentHealthHomeCarePlanPESNeeds_PsychosocialSupportNeedType.DataTextField  = "CodeName";
                DropDownList_CustomDocumentHealthHomeCarePlanPESNeeds_PsychosocialSupportNeedType.DataValueField = "GlobalCodeID";
                DropDownList_CustomDocumentHealthHomeCarePlanPESNeeds_PsychosocialSupportNeedType.DataSource     = DataViewGlobalCodes;
                DropDownList_CustomDocumentHealthHomeCarePlanPESNeeds_PsychosocialSupportNeedType.DataBind();
                DropDownList_CustomDocumentHealthHomeCarePlanPESNeeds_PsychosocialSupportNeedType.Items.Insert(0, new ListItem("", "0"));
            }
        }
Пример #3
0
        public override void CustomAjaxRequest()
        {
            Literal literalStart    = new Literal();
            Literal literalHtmlText = new Literal();
            Literal literalEnd      = new Literal();

            literalStart.Text = "###StartUc###";
            if (GetRequestParameterValue("CustomAjaxRequestType") == "CountSequenceNumber")
            {
                DataSet dsHealthHomeDocuments = new DataSet();
                dsHealthHomeDocuments = BaseCommonFunctions.GetScreenInfoDataSet();
                int    SequenceCount = 0;
                string tablename     = GetRequestParameterValue("TableName");
                if (dsHealthHomeDocuments.Tables.Contains(tablename))
                {
                    if (dsHealthHomeDocuments.Tables[tablename].Rows.Count > 0)
                    {
                        SequenceCount = Convert.ToInt32(dsHealthHomeDocuments.Tables[tablename].Rows[dsHealthHomeDocuments.Tables[tablename].Rows.Count - 1]["SequenceNumber"]);
                    }
                }
                SequenceCount        = SequenceCount + 1;
                literalHtmlText.Text = GetRequestParameterValue("GridDataTable") + "^" + GetRequestParameterValue("GridDivName") + "^" + GetRequestParameterValue("DataGridID") + "^" + GetRequestParameterValue("ButtonCtrl") + "^" + SequenceCount.ToString();
            }
            literalEnd.Text = "###EndUc###";
            PanelLoadUC.Controls.Add(literalStart);
            PanelLoadUC.Controls.Add(literalHtmlText);
            PanelLoadUC.Controls.Add(literalEnd);
        }
Пример #4
0
        public override void BindControls()
        {
            DataSet dsHealthHomeDocuments = new DataSet();

            dsHealthHomeDocuments = BaseCommonFunctions.GetScreenInfoDataSet();

            DataView dataViewClinician = SHS.BaseLayer.SharedTables.GetSharedTableStaff();

            dataViewClinician.RowFilter = "Clinician='Y' and Active='Y' and ISNULL(RecordDeleted,'N')<>'Y'";
            dataViewClinician.Sort      = "StaffName ASC";
            DropDownList_CustomDocumentHealthHomeCrisisPlans_ClinicianFacilitatingDischarge.DataTextField  = "StaffName";
            DropDownList_CustomDocumentHealthHomeCrisisPlans_ClinicianFacilitatingDischarge.DataValueField = "StaffId";
            DropDownList_CustomDocumentHealthHomeCrisisPlans_ClinicianFacilitatingDischarge.DataSource     = dataViewClinician;
            DropDownList_CustomDocumentHealthHomeCrisisPlans_ClinicianFacilitatingDischarge.DataBind();
            DropDownList_CustomDocumentHealthHomeCrisisPlans_ClinicianFacilitatingDischarge.Items.Insert(0, new ListItem("", "0"));
            DropDownList_CustomDocumentHealthHomeCrisisPlans_ClinicianFacilitatingDischarge.SelectedIndex = 0;
            CustomGrid_CustomDocumentHealthHomeCommPlanFamilyMembers.Bind(ParentDetailPageObject.ScreenId);
            CustomGrid_CustomDocumentHealthHomeMentalHealthCrisisPlanSteps.Bind(ParentDetailPageObject.ScreenId);
            CustomGrid_CustomDocumentHealthHomeCrisisPlanTypes.Bind(ParentDetailPageObject.ScreenId);
            CustomGrid_CustomDocumentHealthHomeCarePlanDiagnoses.Bind(ParentDetailPageObject.ScreenId);

            using (DataView DataViewGlobalCodes = BaseCommonFunctions.FillDropDown("XDIAGNOSISSOURCE", true, "", "", false))
            {
                if (DataViewGlobalCodes != null)
                {
                    DataViewGlobalCodes.Sort = "SortOrder asc";
                    DropDownList_CustomDocumentHealthHomeCarePlanDiagnoses_DiagnosisSource.DataTextField  = "CodeName";
                    DropDownList_CustomDocumentHealthHomeCarePlanDiagnoses_DiagnosisSource.DataValueField = "GlobalCodeID";
                    DropDownList_CustomDocumentHealthHomeCarePlanDiagnoses_DiagnosisSource.DataSource     = DataViewGlobalCodes;
                    DropDownList_CustomDocumentHealthHomeCarePlanDiagnoses_DiagnosisSource.DataBind();
                    DropDownList_CustomDocumentHealthHomeCarePlanDiagnoses_DiagnosisSource.Items.Insert(0, new ListItem("", "0"));
                }
            }
        }
Пример #5
0
        public override void BindControls()
        {
            DataSet dsHealthHomeDocuments = new DataSet();

            dsHealthHomeDocuments = BaseCommonFunctions.GetScreenInfoDataSet();
            BindDropDowns();
            CustomGrid_CustomDocumentHealthHomeCommPlanProviders.Bind(ParentPageObject.ScreenId);
            CustomGrid_CustomDocumentHealthHomeCommPlanFamilyMembers.Bind(ParentPageObject.ScreenId);
            CustomGrid_CustomDocumentHealthHomeCommPlanSocialSupports.Bind(ParentPageObject.ScreenId);
        }
Пример #6
0
    /// <summary>
    /// Davinder Kumar 03-06-2011
    /// Method Use To get the Data of The Rows
    /// </summary>
    protected void GridViewCustomTPNeed_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType != GridViewRowType.Data || e.Row.Cells.Count < 3)
        {
            return;
        }
        if (e.GetValue("NeedId").ToString() != "")
        {
            NeedId = Convert.ToInt32(e.GetValue("NeedId"));
        }
        if (e.GetValue("NeedText").ToString() != "")
        {
            NeedText = HttpUtility.UrlEncode(Convert.ToString(e.GetValue("NeedText")));
        }
        else
        {
            NeedText = string.Empty;
        }

        string Checked = string.Empty;

        using (DataSet dataSetTreatmentPlan = BaseCommonFunctions.GetScreenInfoDataSet())
        {
            //if (e.DataColumn.FieldName == "NeedId")
            //{

            string lstSessionNeedId = string.Empty;

            DataRow[] drSessionNeeds = dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"].Select("NeedId='" + NeedId + "' and ISNULL(RecordDeleted,'N')<>'Y'");

            foreach (DataRow drNeeds in drSessionNeeds)
            {
                lstSessionNeedId += drNeeds["TPGoalId"].ToString() + ",";
            }

            DataRow[] dRowGoalNeed = dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"].Select("TPGoalId='" + TPGoalId + "' AND NeedId='" + NeedId + "' and ISNULL(RecordDeleted,'N')<>'Y'");
            if (dRowGoalNeed.Length > 0)
            {
                Checked = "Checked";
                //e.Row.Cells[0].Text = "<table><tr><td style='width:20px;'><img id=Img_CustomTPGoalNeeds_" + NeedId + " name=Img_CustomTPGoalNeeds_" + NeedId + " src=" + RelativePath + "App_Themes/Includes/Images/deleteIcon.gif  tag=" + dRowGoalNeed[0]["TPGoalNeeds"].ToString() + "   style='cursor:hand;display:None;'  onclick = \"DeleteTpGoalNeeds('" + NeedId + "','" + e.GetValue("LinkedInDb") + "','" + e.GetValue("LinkedInSession") + "');\"/></td><td><input type='checkbox' checked='checked'  id='CheckBox_" + NeedId + "_" + NeedText + "' name='CheckBox_" + NeedId + "_" + NeedText + "' style='width:20px;' onclick=ChangeDisplayChecked('Img_CustomTPGoalNeeds_" + NeedId + "','CheckBox_" + NeedId + "') /> <label for='CheckBox_" + NeedId + "_" + NeedText + "' >" + SHS.BaseLayer.BaseCommonFunctions.TrancateElementText(NeedText, 20) + "</label> <input type='hidden' id='Hidden_" + NeedId + "' value='" + NeedText + "' /> <input type='hidden' id='HiddenSessionNeeds_" + NeedId + "' value='"+lstSessionNeedId+"' /> </td></tr></table>";
                e.Row.Cells[0].Text = "<table width='43'><tr><td style='width:18px;'><img id='Img_CustomTPGoalNeeds_" + NeedId + "' name='Img_CustomTPGoalNeeds_" + NeedId + "' src='" + RelativePath + "App_Themes/Includes/Images/deleteIcon.gif'  tag='" + dRowGoalNeed[0]["TPGoalNeeds"].ToString() + "'   style='cursor:hand;display:None;'  onclick = \"DeleteTpGoalNeeds('" + NeedId + "','" + e.GetValue("LinkedInDb") + "','" + e.GetValue("LinkedInSession") + "');\"/></td><td style='width:18px'><input type='checkbox' checked='checked'  id='CheckBox_" + NeedId + "' name='CheckBox_" + NeedId + "' onclick=ChangeDisplayChecked('Img_CustomTPGoalNeeds_" + NeedId + "','CheckBox_" + NeedId + "') /> <input type='hidden' id='Hidden_" + NeedId + "' value='" + NeedText + "' /> <input type='hidden' id='HiddenSessionNeeds_" + NeedId + "' value='" + lstSessionNeedId + "' /> </td></tr></table>";
                e.Row.Cells[2].Text = (dRowGoalNeed[0]["DateNeedAddedtoPlan"].ToString().Trim() != string.Empty) ? Convert.ToDateTime(dRowGoalNeed[0]["DateNeedAddedtoPlan"]).ToString("MM/dd/yyyy") : "";
            }
            else
            {
                Checked             = string.Empty;
                e.Row.Cells[0].Text = "<table width='43'><tr><td style='width:18px;'><img id='Img_CustomTPGoalNeeds_" + NeedId + "'  name='Img_CustomTPGoalNeeds_" + NeedId + "' src='" + RelativePath + "App_Themes/Includes/Images/deleteIcon.gif'  tag='" + -1 + "'   style='cursor:hand;display:block;' onclick = \"DeleteTpGoalNeeds('" + NeedId + "','" + e.GetValue("LinkedInDb") + "','" + e.GetValue("LinkedInSession") + "');\"/></td><td style='width:18px'><input type='checkbox'  id='CheckBox_" + NeedId + "' name='CheckBox_" + NeedId + "' onclick=ChangeDisplayChecked('Img_CustomTPGoalNeeds_" + NeedId + "','CheckBox_" + NeedId + "') /><input type='hidden' id='Hidden_" + NeedId + "' value='" + NeedText + "' /> <input type='hidden' id='HiddenSessionNeeds_" + NeedId + "' value='" + lstSessionNeedId + "' /> </td></tr></table>";
            }
            e.Row.Cells[1].Text = "<label for='CheckBox_" + NeedId + "_" + NeedText + "' id='label_" + NeedId + "'>" + SHS.BaseLayer.BaseCommonFunctions.TrancateElementText(HttpUtility.UrlDecode(NeedText), 20) + "</label>";
            //GrantPermissionTemplateItems

            //e.DataColumn.CellStyle.HorizontalAlign = HorizontalAlign.Center;
            //DataRow[] dRowGoalNeed = dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"].Select("TPGoalId='" + TPGoalId + "' AND NeedId='" + NeedId + "' and ISNULL(RecordDeleted,'N')<>'Y'");
        }
    }
Пример #7
0
    public void GetClientProgramsList()
    {
        StringBuilder ClientProgramsList = null;

        ClientProgramsList = new StringBuilder();

        SqlParameter[] _objectSqlParmeters = null;
        _objectSqlParmeters    = new SqlParameter[1];
        _objectSqlParmeters[0] = new SqlParameter("@ClientId", SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.Client.ClientId);
        DataSet dataSetClientProgramsList = new DataSet();

        SqlHelper.FillDataset(Connection.ConnectionString, CommandType.StoredProcedure, "csp_GetClientProgramsList", dataSetClientProgramsList, new string[] { "ClientProgramsList" }, _objectSqlParmeters);

        if (dataSetClientProgramsList != null)
        {
            if (dataSetClientProgramsList.Tables.Count > 0 && dataSetClientProgramsList.Tables["ClientProgramsList"].Rows.Count > 0)
            {
                ClientProgramsList.Append("[");
                string CustomDischargeNewPrimaryProgramId = string.Empty;
                string primaryAssignment = string.Empty;
                //EI#677.2 - Analysis and Resolution to Fix - Exception: "There is no row at position 0" in SmartCare Application
                if (BaseCommonFunctions.GetScreenInfoDataSet().IsDataTableFound("CustomDocumentDischarges"))
                {
                    CustomDischargeNewPrimaryProgramId = BaseCommonFunctions.GetScreenInfoDataSet().Tables["CustomDocumentDischarges"].Rows[0]["NewPrimaryClientProgramId"].ToString();
                }

                for (int Count = 0; Count < dataSetClientProgramsList.Tables["ClientProgramsList"].Rows.Count; Count++)
                {
                    if (CustomDischargeNewPrimaryProgramId == dataSetClientProgramsList.Tables["ClientProgramsList"].Rows[Count]["ClientProgramId"].ToString())
                    {
                        primaryAssignment = "Y";
                    }
                    else
                    {
                        primaryAssignment = Convert.ToString(dataSetClientProgramsList.Tables["ClientProgramsList"].Rows[Count]["PrimaryAssignment"]);
                    }
                    ClientProgramsList.Append("{ " + "ProgramCode: \"" + Convert.ToString(dataSetClientProgramsList.Tables["ClientProgramsList"].Rows[Count]["ProgramCode"]) + "\"," + "PrimaryAssignment: \"" + primaryAssignment + "\"," + "ClientProgramId: " + Convert.ToString(dataSetClientProgramsList.Tables["ClientProgramsList"].Rows[Count]["ClientProgramId"]) + "," + "EnrolledDate: \"" + Convert.ToString(dataSetClientProgramsList.Tables["ClientProgramsList"].Rows[Count]["EnrolledDate"]) + "\" },");
                }
                ClientProgramsList = ClientProgramsList.Remove(ClientProgramsList.Length - 1, 1);
                ClientProgramsList.Append("];");
            }
            else
            {
                ClientProgramsList.Append("[];");
            }
        }
        Response.Clear();
        Response.Write(ClientProgramsList.ToString());
        Response.End();
    }
Пример #8
0
    private void DeleteDiagnosisOnSubstanceUnSelect(string Substance)
    {
        var dataSetDocument = BaseCommonFunctions.GetScreenInfoDataSet();

        if (BaseCommonFunctions.CheckRowExists(dataSetDocument, "CustomPsychiatricNoteSubstanceUses"))
        {
            DataRow[] datarowGoalRelatedObjs = dataSetDocument.Tables["CustomPsychiatricNoteSubstanceUses"].Select("SubstanceUseName='" + Substance + "' and  ISNULL(RecordDeleted,'N')='N' ");
            if (datarowGoalRelatedObjs.Length > 0)
            {
                foreach (DataRow datarowCurrent in datarowGoalRelatedObjs)
                {
                    int ICD10CodeId = (int)datarowCurrent["DocumentDiagnosisCodeId"];
                    DeletefromDocumentDiagnosisCodes(ICD10CodeId, Substance);
                    BaseCommonFunctions.UpdateRecordDeletedInformation(datarowCurrent);
                }
            }
        }
    }
Пример #9
0
    /// <summary>
    /// Davinder Kumar 02-May 2011
    /// Method to Bind The Need grid on the Popup
    /// </summary>
    protected override void OnLoad(EventArgs e)
    {
        //SHS.UserBusinessServices.CustomTPNeeds customTPNeeds = null;
        //customTPNeeds = new SHS.UserBusinessServices.CustomTPNeeds();
        DataView DataViewCustomTPNeeds = null;

        try
        {
            using (DataSet datasetCustomTPNeed = BaseCommonFunctions.GetScreenInfoDataSet())
            {
                HiddenField_TPGoalId.Value = GetRequestParameterValue("TPGoalId");
                TPGoalId = Convert.ToInt32(HiddenField_TPGoalId.Value);

                ///////////////////////////
                //var res=from ctpn in datasetCustomTPNeed.Tables["CustomTPNeeds"].AsEnumerable()
                //        join ctpgn in datasetCustomTPNeed.Tables["CustomTPGoalNeeds"].AsEnumerable()
                //        on ctpn.Field<int>("CustomTPNeedId") equals ctpgn.Field<int>("CustomTPNeedId") into joinedTable
                //        from ch in joinedTable.DefaultIfEmpty()
                //        select new
                //        {
                //            CustomTPNeedId=ctpn.Field<int>("CustomTPNeedId"),
                //            NeedText=ctpn.Field<string>("NeedText"),
                //            Need
                //        }


                //////////////////////////


                DataViewCustomTPNeeds           = datasetCustomTPNeed.Tables["CustomTPNeeds"].DefaultView;
                DataViewCustomTPNeeds.RowFilter = "isnull(RecordDeleted,'N')<>'Y'";
                GridViewCustomTPNeed.DataSource = DataViewCustomTPNeeds;

                //GridViewCustomTPNeed.DataSource = datasetCustomTPNeed.Tables["CustomTPNeeds"];
                GridViewCustomTPNeed.DataBind();
            }
        }
        finally
        {
            DataViewCustomTPNeeds = null;
            //customTPNeeds = null;
        }
    }
Пример #10
0
        public override void BindControls()
        {
            DataSet dsHealthHomeDocuments = new DataSet();

            dsHealthHomeDocuments = BaseCommonFunctions.GetScreenInfoDataSet();

            DataView dataViewClinician = SHS.BaseLayer.SharedTables.GetSharedTableStaff();

            dataViewClinician.RowFilter = "Clinician='Y' and Active='Y' and ISNULL(RecordDeleted,'N')<>'Y'";
            dataViewClinician.Sort      = "StaffName ASC";
            DropDownList_CustomDocumentHealthHomeTransitionPlans_ClinicianCoordinatingDischarge.DataTextField  = "StaffName";
            DropDownList_CustomDocumentHealthHomeTransitionPlans_ClinicianCoordinatingDischarge.DataValueField = "StaffId";
            DropDownList_CustomDocumentHealthHomeTransitionPlans_ClinicianCoordinatingDischarge.DataSource     = dataViewClinician;
            DropDownList_CustomDocumentHealthHomeTransitionPlans_ClinicianCoordinatingDischarge.DataBind();
            DropDownList_CustomDocumentHealthHomeTransitionPlans_ClinicianCoordinatingDischarge.Items.Insert(0, new ListItem("", "0"));
            DropDownList_CustomDocumentHealthHomeTransitionPlans_ClinicianCoordinatingDischarge.SelectedIndex = 0;

            using (DataView DataViewGlobalCodes = BaseCommonFunctions.FillDropDown("XHHTRANSENTITY", true, "", "", false))
            {
                if (DataViewGlobalCodes != null)
                {
                    DataViewGlobalCodes.Sort = "SortOrder asc";
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionFromEntityType.DataTextField  = "CodeName";
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionFromEntityType.DataValueField = "GlobalCodeID";
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionFromEntityType.DataSource     = DataViewGlobalCodes;
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionFromEntityType.DataBind();
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionFromEntityType.Items.Insert(0, new ListItem("", "0"));
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionFromEntityType.SelectedIndex = 0;

                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionToEntityType.DataTextField  = "CodeName";
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionToEntityType.DataValueField = "GlobalCodeID";
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionToEntityType.DataSource     = DataViewGlobalCodes;
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionToEntityType.DataBind();
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionToEntityType.Items.Insert(0, new ListItem("", "0"));
                    DropDownList_CustomDocumentHealthHomeTransitionPlans_TransitionToEntityType.SelectedIndex = 0;
                }
            }

            CustomGrid_CustomDocumentHealthHomeReferrals.Bind(ParentDetailPageObject.ScreenId);
            CustomGrid_CustomDocumentHealthHomePriorAuthorizations.Bind(ParentDetailPageObject.ScreenId);
        }
Пример #11
0
    private void DeletefromDocumentDiagnosisCodes(int ICD10CodeId, string Substance)
    {
        //ArrayList drHash1 = new ArrayList();
        if (BaseCommonFunctions.GetScreenInfoDataSet().Tables.Contains("DocumentDiagnosisCodes"))
        {
            foreach (DataRow row in BaseCommonFunctions.GetScreenInfoDataSet().Tables["DocumentDiagnosisCodes"].Select("ICD10CodeId = " + ICD10CodeId))
            {
                row.BeginEdit();
                row["RecordDeleted"] = 'Y';
                row["DeletedBy"]     = SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserCode;
                row["DeletedDate"]   = DateTime.Now;
                row.EndEdit();
                //  drHash1.Add(row);
            }
        }
        string    diagnosisColumn           = Substance + "Diagnosis";
        int       documentversionId         = -1;
        var       dataSetDocument           = BaseCommonFunctions.GetScreenInfoDataSet();
        DataTable datatableDocumentVersions = dataSetDocument.Tables["DocumentVersions"];

        if (BaseCommonFunctions.CheckRowExists(datatableDocumentVersions, 0))
        {
            documentversionId = Convert.ToInt32(datatableDocumentVersions.Rows[0]["DocumentVersionId"]);
        }
        DataTable datatableCustomDocumentPsychiatricNoteGenerals = dataSetDocument.Tables["CustomDocumentPsychiatricNoteGenerals"];

        if (BaseCommonFunctions.CheckRowExists(datatableCustomDocumentPsychiatricNoteGenerals, 0))
        {
            foreach (DataRow row in BaseCommonFunctions.GetScreenInfoDataSet().Tables["CustomDocumentPsychiatricNoteGenerals"].Select("DocumentVersionId = " + documentversionId))
            {
                row.BeginEdit();
                row[diagnosisColumn] = "";
                row.EndEdit();
            }
        }
    }
Пример #12
0
    public override void ChangeDataSetAfterGetData()
    {
        using (SHS.UserBusinessServices.HarborTreatmentPlan objHarborTreatmentPlan = new SHS.UserBusinessServices.HarborTreatmentPlan())
        {
            int    staffId         = BaseCommonFunctions.GetUserIdInCaseOfMultipleDataBase();
            string InitialOrUpdate = "";
            if (BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet, "CustomDocumentDiagnosticAssessments", 0))
            {
                InitialOrUpdate = BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomDocumentDiagnosticAssessments"].Rows[0]["InitialOrUpdate"].ToString();
            }
            if (InitialOrUpdate != "" && InitialOrUpdate == "U")
            {
                return;
            }

            using (DataSet dataSetObject = BaseCommonFunctions.GetScreenInfoDataSet())
            {
                //int DocumentVersionId = Convert.ToInt32(dataSetObject.Tables["DocumentVersions"].Rows[0]["DocumentVersionId"].ToString());
                DataSet dataSetTreatmentPlan = objHarborTreatmentPlan.GetTreatmentPlanInitial_2(BaseCommonFunctions.ApplicationInfo.Client.ClientId, staffId, "A");

                if (dataSetTreatmentPlan != null)
                {
                    //if (BaseCommonFunctions.CheckRowExists(dataSetTreatmentPlan, "CustomTPNeeds", 0))
                    //{

                    /*
                     * //dataSetObject.Tables["CustomTPGoalNeeds"].Clear();
                     * //dataSetObject.Tables["CustomTPNeeds"].Clear();
                     *
                     * try
                     * {
                     *  dataSetObject.Merge(dataSetTreatmentPlan, true, MissingSchemaAction.Ignore);
                     * }
                     *
                     *
                     * catch
                     * {
                     *  dataSetObject.Merge(dataSetTreatmentPlan, true, MissingSchemaAction.Ignore);
                     * }
                     */

                    if (BaseCommonFunctions.CheckRowExists(dataSetTreatmentPlan, "CustomTPNeeds", 0))
                    {
                        try
                        {
                            if (dataSetTreatmentPlan.Tables["CustomTPNeeds"] != null)
                            {
                                dataSetObject.Tables["CustomTPNeeds"].Merge(dataSetTreatmentPlan.Tables["CustomTPNeeds"], true, MissingSchemaAction.Ignore);
                            }
                        }
                        catch
                        {
                            if (dataSetTreatmentPlan.Tables["CustomTPNeeds"] != null)
                            {
                                dataSetObject.Tables["CustomTPNeeds"].Merge(dataSetTreatmentPlan.Tables["CustomTPNeeds"], true, MissingSchemaAction.Ignore);
                            }
                        }

                        //try
                        //{
                        //    if (dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"] != null)
                        //        dataSetObject.Tables["CustomTPGoalNeeds"].Merge(dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"], true, MissingSchemaAction.Ignore);
                        //}
                        //catch
                        //{
                        //    if (dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"] != null)
                        //        dataSetObject.Tables["CustomTPGoalNeeds"].Merge(dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"], true, MissingSchemaAction.Ignore);
                        //}

                        if (Convert.ToInt32(dataSetObject.Tables["Documents"].Rows[0]["DocumentId"]) == 0)
                        {
                            foreach (DataRow dr in dataSetObject.Tables["CustomTPGoalNeeds"].Rows)
                            {
                                dr.AcceptChanges();
                                dr.SetAdded();
                            }
                        }
                    }
                    //Code commented by jagdeep to remove CustomTPQuick* from unsaved changes
                    //Strat
                    //try
                    //{
                    //    if (dataSetTreatmentPlan.Tables["CustomTPQuickObjectives"] != null)
                    //    {
                    //        dataSetObject.Tables["CustomTPQuickObjectives"].Clear();
                    //        dataSetObject.Tables["CustomTPQuickObjectives"].Merge(dataSetTreatmentPlan.Tables["CustomTPQuickObjectives"], true, MissingSchemaAction.Ignore);
                    //    }
                    //}
                    //catch
                    //{
                    //    if (dataSetTreatmentPlan.Tables["CustomTPQuickObjectives"] != null)
                    //    {
                    //        dataSetObject.Tables["CustomTPQuickObjectives"].Clear();
                    //        dataSetObject.Tables["CustomTPQuickObjectives"].Merge(dataSetTreatmentPlan.Tables["CustomTPQuickObjectives"], true, MissingSchemaAction.Ignore);
                    //    }
                    //}
                    //end

                    //try
                    //{
                    //    if (dataSetTreatmentPlan.Tables["CustomTPGlobalQuickTransitionPlans"] != null)
                    //    {
                    //        dataSetObject.Tables["CustomTPGlobalQuickTransitionPlans"].Clear();
                    //        dataSetObject.Tables["CustomTPGlobalQuickTransitionPlans"].Merge(dataSetTreatmentPlan.Tables["CustomTPGlobalQuickTransitionPlans"], true, MissingSchemaAction.Ignore);
                    //    }
                    //}
                    //catch
                    //{
                    //    if (dataSetTreatmentPlan.Tables["CustomTPGlobalQuickTransitionPlans"] != null)
                    //    {
                    //        dataSetObject.Tables["CustomTPGlobalQuickTransitionPlans"].Clear();
                    //        dataSetObject.Tables["CustomTPGlobalQuickTransitionPlans"].Merge(dataSetTreatmentPlan.Tables["CustomTPGlobalQuickTransitionPlans"], true, MissingSchemaAction.Ignore);
                    //    }
                    //}

                    //Code commented by jagdeep to remove CustomTPQuick* from unsaved changes
                    //dataSetObject.Tables["CustomTPGlobalQuickTransitionPlans"].AcceptChanges();
                    //dataSetObject.Tables["CustomTPGlobalQuickGoals"].AcceptChanges();
                    //End

                    //try
                    //{
                    //    if (dataSetTreatmentPlan.Tables["CustomTPGlobalQuickGoals"] != null)
                    //    {
                    //        dataSetObject.Tables["CustomTPGlobalQuickGoals"].Clear();
                    //        dataSetObject.Tables["CustomTPGlobalQuickGoals"].Merge(dataSetTreatmentPlan.Tables["CustomTPGlobalQuickGoals"], true, MissingSchemaAction.Ignore);
                    //    }
                    //}
                    //catch
                    //{
                    //    if (dataSetTreatmentPlan.Tables["CustomTPGlobalQuickGoals"] != null)
                    //    {
                    //        dataSetObject.Tables["CustomTPGlobalQuickGoals"].Clear();
                    //        dataSetObject.Tables["CustomTPGlobalQuickGoals"].Merge(dataSetTreatmentPlan.Tables["CustomTPGlobalQuickGoals"], true, MissingSchemaAction.Ignore);
                    //    }
                    //}
                }
                //}

                foreach (DataRow dr in dataSetObject.Tables["CustomTPNeeds"].Rows)
                {
                    if (Convert.ToInt32(dr[0]) > 0 && dr.RowState == DataRowState.Added)
                    {
                        dr.AcceptChanges();
                        dr.SetModified();
                    }
                }

                //if (dataSetObject.Tables.Contains("CustomTPNeeds"))
                //{
                //    dataSetObject.Tables["CustomTPNeeds"].AcceptChanges();
                //}
            }


            //using (DataSet dataSetObject = BaseCommonFunctions.GetScreenInfoDataSet())
            //    if (dataSetObject.Tables.Contains("CustomTPNeeds"))
            //    {
            //        foreach (DataRow dr in dataSetObject.Tables["CustomTPNeeds"].Rows)
            //        {
            //            if (Convert.ToInt32(dr[0]) > 0)
            //            {
            //                dr.AcceptChanges();
            //            }
            //        }
            //    }
        }
    }
Пример #13
0
    private static void AddDiagnosis(string ICD10Code, string ICD9Code, int ICD10CodeId, string Description, string Substance, int SeverityId)
    {
        var       dataSetDocument           = BaseCommonFunctions.GetScreenInfoDataSet();
        string    diagnosisColumn           = Substance + "Diagnosis";
        string    DiagDescription           = ICD10Code + " - " + Description;
        int       documentversionId         = -1;
        DataTable datatableDocumentVersions = dataSetDocument.Tables["DocumentVersions"];

        if (BaseCommonFunctions.CheckRowExists(datatableDocumentVersions, 0))
        {
            documentversionId = Convert.ToInt32(datatableDocumentVersions.Rows[0]["DocumentVersionId"]);
        }

        DataTable datatableCustomDocumentPsychiatricNoteGenerals = dataSetDocument.Tables["CustomDocumentPsychiatricNoteGenerals"];

        if (BaseCommonFunctions.CheckRowExists(datatableCustomDocumentPsychiatricNoteGenerals, 0))
        {
            foreach (DataRow row in BaseCommonFunctions.GetScreenInfoDataSet().Tables["CustomDocumentPsychiatricNoteGenerals"].Select("DocumentVersionId = " + documentversionId))
            {
                row.BeginEdit();
                row[diagnosisColumn] = DiagDescription;
                row.EndEdit();
            }
        }



        DataTable datatableDiagnosisCodes = dataSetDocument.Tables["DocumentDiagnosisCodes"];
        DataTable dtSubstanceUses         = dataSetDocument.Tables["CustomPsychiatricNoteSubstanceUses"];
        //if (dataSetDocument.Tables["CustomPsychiatricNoteSubstanceUses"].Constraints.Contains("ForeignKey_CustomPsychiatricNoteSubstanceUses") == false)
        //{
        //    ForeignKeyConstraint fk = new ForeignKeyConstraint(
        //    "ForeignKey_CustomPsychiatricNoteSubstanceUses", datatableDiagnosisCodes.Columns["DocumentDiagnosisCodeId"], dtSubstanceUses.Columns["DocumentDiagnosisCodeId"]);
        //    dtSubstanceUses.Constraints.Add(fk);
        //    fk.DeleteRule = Rule.Cascade;
        //    fk.UpdateRule = Rule.Cascade;
        //    fk.AcceptRejectRule = AcceptRejectRule.Cascade;
        //    dataSetDocument.EnforceConstraints = true;
        //}


        DataRow datarowNewGoal = datatableDiagnosisCodes.NewRow();
        int     minGoalId      = -1;

        DataRow[] datarowGoalWithMinId = datatableDiagnosisCodes.Select("DocumentDiagnosisCodeId<0");
        if (datarowGoalWithMinId.Length > 0)
        {
            minGoalId = Convert.ToInt32(datatableDiagnosisCodes.Compute("Min(DocumentDiagnosisCodeId)", "DocumentDiagnosisCodeId<0")) - 1;
        }
        datarowNewGoal["DocumentDiagnosisCodeId"] = minGoalId;
        if (datatableDiagnosisCodes.Select("ISNULL(RecordDeleted,'N')<>'Y'").Length > 0)
        {
            datarowNewGoal["DiagnosisOrder"] = Convert.ToInt32(datatableDiagnosisCodes.Compute("Max(DiagnosisOrder)", "ISNULL(RecordDeleted,'N')<>'Y'")) + 1;
        }
        else
        {
            datarowNewGoal["DiagnosisOrder"] = "1";
        }
        datarowNewGoal["ICD10CodeId"]       = ICD10CodeId;
        datarowNewGoal["ICD10Code"]         = ICD10Code;
        datarowNewGoal["ICD9Code"]          = ICD9Code;
        datarowNewGoal["DiagnosisType"]     = 142;
        datarowNewGoal["Billable"]          = "Y";
        datarowNewGoal["Severity"]          = SeverityId;
        datarowNewGoal["Source"]            = Substance;
        datarowNewGoal["DSMDescription"]    = Description;
        datarowNewGoal["DocumentVersionId"] = documentversionId;
        BaseCommonFunctions.InitRowCredentials(datarowNewGoal);
        datatableDiagnosisCodes.Rows.Add(datarowNewGoal);

        //int DocumentDiagnosisCodeId = -1;
        //if (dataSetDocument.Tables["DocumentDiagnosisCodes"].Rows.Count > 0)
        //{
        //    DocumentDiagnosisCodeId = Convert.ToInt32(dataSetDocument.Tables["DocumentDiagnosisCodes"].Compute("min([DocumentDiagnosisCodeId])", string.Empty));
        //}


        DataRow newdatarow = dtSubstanceUses.NewRow();

        SHS.BaseLayer.BaseCommonFunctions.InitRowCredentials(newdatarow);
        newdatarow["DocumentDiagnosisCodeId"] = ICD10CodeId;
        newdatarow["DocumentVersionId"]       = documentversionId;
        newdatarow["SubstanceUseName"]        = Substance;
        dtSubstanceUses.Rows.Add(newdatarow);
    }
Пример #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        functionName = Request.QueryString["FunctionName"].ToString();
        switch (functionName)
        {
        case "GetPainLocations":
            var painLocations = from g in SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes.AsEnumerable()
                                where g.Category.Trim() == "XPainLocation"
                                orderby g.CodeName ascending
                                select new GlobalCodes()
            {
                GlobalCodeId = g.GlobalCodeId,
                CodeName     = g.CodeName
            };
            var painLevel = from g in SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes.AsEnumerable()
                            where g.Category.Trim() == "XPainlevel"
                            select new GlobalCodes()
            {
                GlobalCodeId = g.GlobalCodeId,
                CodeName     = g.CodeName
            };
            var painIndicator = from g in SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes.AsEnumerable()
                                where g.Category.Trim() == "XPainLevelImpClients"
                                orderby g.CodeName ascending
                                select new GlobalCodes()
            {
                GlobalCodeId = g.GlobalCodeId,
                CodeName     = g.CodeName
            };
            Response.Clear();
            Response.Write(painLocations.ToJSON() + "^" + painLevel.ToJSON() + "^" + painIndicator.ToJSON());
            Response.End();
            break;

        case "GetPainLevel":
            break;

        case "XPainLevelImpClients":
            break;

        case "GetProviderDetail":
            GetProviderDetail();
            break;

        case "GetProviderName":
            GetProviderName();
            break;

        case "RefreshProvideDetail":
            RefreshProvideDetail();
            break;

        case "CurrentAllergy":
            string list      = string.Empty;
            int    _ClientId = SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.Client.ClientId;
            list = GetCurrentAllergylist(_ClientId);
            Response.Write(list);
            Response.End();
            break;

        case "UpdateProviderDetails":
            string ReferralProviderId = Request.Form["ExternalReferralProviderId"].ToString();
            GetProviderDetails(ReferralProviderId);
            break;

        case "CurrentAllergyAndMedications":
            DataSet NursingAssessmentCurrentAllergies = new DataSet();
            NursingAssessmentCurrentAllergies = dataSetGetCurrentAllergies();
            DataSet NursingAssessmentCurrentMedication = new DataSet();
            NursingAssessmentCurrentMedication = dataSetGetCurrentMedication();
            DataSet dsResult = new DataSet();
            dsResult.Tables.Add(NursingAssessmentCurrentAllergies.Tables["ClientAllergies"].Copy());
            dsResult.Tables.Add(NursingAssessmentCurrentMedication.Tables["ClientMedications"].Copy());
            dsResult.Tables.Add(NursingAssessmentCurrentMedication.Tables["CurrentMedicationHistory"].Copy());
            StringWriter sw1 = new StringWriter();
            dsResult.WriteXml(sw1);
            string resultPIE1 = sw1.ToString();
            Response.Write(resultPIE1);
            Response.End();
            break;

        case "GetBMIPercentile":
            string  listPercentile = string.Empty;
            int     ClientId       = BaseCommonFunctions.ApplicationInfo.Client.ClientId;
            Decimal BMI;
            BMI = Convert.ToDecimal(Request.QueryString["BMIValue"].ToString());
            Decimal.TryParse(Request.QueryString["BMIValue"].ToString(), out BMI);
            SqlParameter[] _objectSqlParmeters = new SqlParameter[2];
            _objectSqlParmeters[0] = new SqlParameter("@ClientId", ClientId);
            _objectSqlParmeters[1] = new SqlParameter("@BMI", BMI);
            listPercentile         = Convert.ToString(SqlHelper.ExecuteScalar(Connection.ConnectionString, "csp_SCCalculateClientAgePercentile", _objectSqlParmeters));
            if (listPercentile == "< 3rd %ile" || listPercentile == "> 97th %ile")
            {
                listPercentile = "Value" + listPercentile;
            }
            Response.Clear();
            Response.Write(listPercentile);
            Response.End();
            break;

        case "GetRecodeData":
            string    Count           = string.Empty;
            string    ProcedureCodeId = string.Empty;
            DataTable Services        = BaseCommonFunctions.GetScreenInfoDataSet().Tables["Services"];
            ProcedureCodeId = Services.Rows[0]["ProcedureCodeId"].ToString();
            DataSet Recodes = new DataSet();

            try
            {
                _objectSqlParmeters    = new SqlParameter[1];
                _objectSqlParmeters[0] = new SqlParameter("@ProcedureCodeId", Convert.ToInt32(ProcedureCodeId));
                SqlHelper.FillDataset(Connection.ConnectionString, CommandType.StoredProcedure, "csp_RecodePresent", Recodes, new string[] { "Recodes" }, _objectSqlParmeters);
            }
            catch (Exception ex)
            {
            }

            if (Recodes.Tables["Recodes"].Rows.Count > 0)
            {
                Count = "1";
            }
            else
            {
                Count = "0";
            }
            Response.Clear();
            Response.Write(Count);
            Response.End();
            break;

        case "PregnentRule":
            string Y_N_A    = string.Empty;
            string dob      = string.Empty;
            string gender   = string.Empty;
            string datetime = DateTime.Now.ToString("yyyy");
            int    age      = 0;
            try
            {
                DataSet PregentRule = getPregentRule();
                gender = PregentRule.Tables["PregnentRuleData"].Rows[0]["Sex"].ToString();
                dob    = Convert.ToDateTime(PregentRule.Tables["PregnentRuleData"].Rows[0]["DOB"].ToString()).ToString("yyyy");
                age    = Convert.ToInt32(datetime) - Convert.ToInt32(dob);
                if (gender == "F")
                {
                    if (age > 55 || age < 9)
                    {
                        Y_N_A = "A";
                    }
                }
                if (gender == "M")
                {
                    Y_N_A = "A";
                }

                if (gender == "" || gender == null)
                {
                    Y_N_A = "A";
                }
            }
            catch (Exception ex1)
            {
            }

            Response.Clear();
            Response.Write(Y_N_A);
            Response.End();
            break;

        default:
            break;
        }
    }
Пример #15
0
        public override void ChangeDataSetAfterGetData()
        {
            base.ChangeDataSetAfterGetData();


            using (SHS.UserBusinessServices.HarborTreatmentPlan objHarborTreatmentPlan = new SHS.UserBusinessServices.HarborTreatmentPlan())
            {
                int staffId = BaseCommonFunctions.GetUserIdInCaseOfMultipleDataBase();

                using (DataSet dataSetObject = BaseCommonFunctions.GetScreenInfoDataSet())
                {
                    int DocumentVersionId = Convert.ToInt32(dataSetObject.Tables["DocumentVersions"].Rows[0]["DocumentVersionId"].ToString());

                    DataSet dataSetTreatmentPlan = objHarborTreatmentPlan.GetTreatmentPlanInitial_2(BaseCommonFunctions.ApplicationInfo.Client.ClientId, staffId, "T");

                    if (dataSetTreatmentPlan != null)
                    {
                        //if (BaseCommonFunctions.CheckRowExists(dataSetTreatmentPlan, "CustomTPNeeds", 0))
                        //{

                        /*
                         * //dataSetObject.Tables["CustomTPGoalNeeds"].Clear();
                         * //dataSetObject.Tables["CustomTPNeeds"].Clear();
                         *
                         * try
                         * {
                         *  dataSetObject.Merge(dataSetTreatmentPlan, true, MissingSchemaAction.Ignore);
                         * }
                         *
                         *
                         * catch
                         * {
                         *  dataSetObject.Merge(dataSetTreatmentPlan, true, MissingSchemaAction.Ignore);
                         * }
                         */

                        if (BaseCommonFunctions.CheckRowExists(dataSetTreatmentPlan, "CustomTPNeeds", 0))
                        {
                            try
                            {
                                if (dataSetTreatmentPlan.Tables["CustomTPNeeds"] != null)
                                {
                                    dataSetObject.Tables["CustomTPNeeds"].Merge(dataSetTreatmentPlan.Tables["CustomTPNeeds"], true, MissingSchemaAction.Ignore);
                                }
                            }
                            catch
                            {
                                if (dataSetTreatmentPlan.Tables["CustomTPNeeds"] != null)
                                {
                                    dataSetObject.Tables["CustomTPNeeds"].Merge(dataSetTreatmentPlan.Tables["CustomTPNeeds"], true, MissingSchemaAction.Ignore);
                                }
                            }

                            //try
                            //{
                            //    if (dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"] != null)
                            //        dataSetObject.Tables["CustomTPGoalNeeds"].Merge(dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"], true, MissingSchemaAction.Ignore);
                            //}
                            //catch
                            //{
                            //    if (dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"] != null)
                            //        dataSetObject.Tables["CustomTPGoalNeeds"].Merge(dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"], true, MissingSchemaAction.Ignore);
                            //}

                            if (Convert.ToInt32(dataSetObject.Tables["Documents"].Rows[0]["DocumentId"]) == 0)
                            {
                                foreach (DataRow dr in dataSetObject.Tables["CustomTPGoalNeeds"].Rows)
                                {
                                    dr.AcceptChanges();
                                    dr.SetAdded();
                                }
                            }
                        }
                        try
                        {
                            if (dataSetTreatmentPlan.Tables["CustomTPQuickObjectives"] != null)
                            {
                                dataSetObject.Tables["CustomTPQuickObjectives"].Clear();
                                dataSetObject.Tables["CustomTPQuickObjectives"].Merge(dataSetTreatmentPlan.Tables["CustomTPQuickObjectives"], true, MissingSchemaAction.Ignore);
                            }
                        }
                        catch
                        {
                            if (dataSetTreatmentPlan.Tables["CustomTPQuickObjectives"] != null)
                            {
                                dataSetObject.Tables["CustomTPQuickObjectives"].Clear();
                                dataSetObject.Tables["CustomTPQuickObjectives"].Merge(dataSetTreatmentPlan.Tables["CustomTPGlobalQuickTransitionPlans"], true, MissingSchemaAction.Ignore);
                            }
                        }
                        //try
                        //{
                        //    if (dataSetTreatmentPlan.Tables["CustomTPGlobalQuickTransitionPlans"] != null)
                        //    {
                        //        dataSetObject.Tables["CustomTPGlobalQuickTransitionPlans"].Clear();
                        //        dataSetObject.Tables["CustomTPGlobalQuickTransitionPlans"].Merge(dataSetTreatmentPlan.Tables["CustomTPGlobalQuickTransitionPlans"], true, MissingSchemaAction.Ignore);
                        //    }
                        //}
                        //catch
                        //{
                        //    if (dataSetTreatmentPlan.Tables["CustomTPGlobalQuickTransitionPlans"] != null)
                        //    {
                        //        dataSetObject.Tables["CustomTPGlobalQuickTransitionPlans"].Clear();
                        //        dataSetObject.Tables["CustomTPGlobalQuickTransitionPlans"].Merge(dataSetTreatmentPlan.Tables["CustomTPGlobalQuickTransitionPlans"], true, MissingSchemaAction.Ignore);
                        //    }
                        //}
                        dataSetObject.Tables["CustomTPGlobalQuickTransitionPlans"].AcceptChanges();
                        dataSetObject.Tables["CustomTPGlobalQuickGoals"].AcceptChanges();
                        //try
                        //{
                        //    if (dataSetTreatmentPlan.Tables["CustomTPGlobalQuickGoals"] != null)
                        //    {
                        //        dataSetObject.Tables["CustomTPGlobalQuickGoals"].Clear();
                        //        dataSetObject.Tables["CustomTPGlobalQuickGoals"].Merge(dataSetTreatmentPlan.Tables["CustomTPGlobalQuickGoals"], true, MissingSchemaAction.Ignore);
                        //    }
                        //}
                        //catch
                        //{
                        //    if (dataSetTreatmentPlan.Tables["CustomTPGlobalQuickGoals"] != null)
                        //    {
                        //        dataSetObject.Tables["CustomTPGlobalQuickGoals"].Clear();
                        //        dataSetObject.Tables["CustomTPGlobalQuickGoals"].Merge(dataSetTreatmentPlan.Tables["CustomTPGlobalQuickGoals"], true, MissingSchemaAction.Ignore);
                        //    }
                        //}
                    }
                    //}

                    foreach (DataRow dr in dataSetObject.Tables["CustomTPNeeds"].Rows)
                    {
                        if (Convert.ToInt32(dr[0]) > 0 && dr.RowState == DataRowState.Added)
                        {
                            dr.AcceptChanges();
                            dr.SetModified();
                        }
                    }

                    //if (dataSetObject.Tables.Contains("CustomTPNeeds"))
                    //{
                    //    dataSetObject.Tables["CustomTPNeeds"].AcceptChanges();
                    //}
                }


                //using (DataSet dataSetObject = BaseCommonFunctions.GetScreenInfoDataSet())
                //    if (dataSetObject.Tables.Contains("CustomTPNeeds"))
                //    {
                //        foreach (DataRow dr in dataSetObject.Tables["CustomTPNeeds"].Rows)
                //        {
                //            if (Convert.ToInt32(dr[0]) > 0)
                //            {
                //                dr.AcceptChanges();
                //            }
                //        }
                //    }
            }
        }
        public override void CustomAjaxRequest()
        {
            if (GetRequestParameterValue("CustomAjaxRequestType") == "CountSequenceNumber")
            {
                Literal literalStart    = new Literal();
                Literal literalHtmlText = new Literal();
                Literal literalEnd      = new Literal();
                literalStart.Text = "###StartUc###";
                DataSet dsHealthHomeDocuments = new DataSet();
                dsHealthHomeDocuments = BaseCommonFunctions.GetScreenInfoDataSet();
                int    SequenceCount = 0;
                string tablename     = GetRequestParameterValue("TableName");
                if (dsHealthHomeDocuments.Tables.Contains(tablename))
                {
                    if (dsHealthHomeDocuments.Tables[tablename].Rows.Count > 0)
                    {
                        SequenceCount = Convert.ToInt32(dsHealthHomeDocuments.Tables[tablename].Rows[dsHealthHomeDocuments.Tables[tablename].Rows.Count - 1]["SequenceNumber"]);
                    }
                }
                SequenceCount        = SequenceCount + 1;
                literalHtmlText.Text = GetRequestParameterValue("GridDataTable") + "^" + GetRequestParameterValue("GridDivName") + "^" + GetRequestParameterValue("DataGridID") + "^" + GetRequestParameterValue("ButtonCtrl") + "^" + SequenceCount.ToString();
                literalEnd.Text      = "###EndUc###";
                PanelLoadUC.Controls.Add(literalStart);
                PanelLoadUC.Controls.Add(literalHtmlText);
                PanelLoadUC.Controls.Add(literalEnd);
            }
            if (GetRequestParameterValue("CustomAjaxRequestType") == "GetCurrentDiagnosis")
            {
                Literal literalStart    = new Literal();
                Literal literalHtmlText = new Literal();
                Literal literalEnd      = new Literal();
                literalStart.Text = "###StartCurrentDiagnosisUc###";

                DataSet        CurrentDiagnosis       = new DataSet();
                string         CurrentDiagnosisString = string.Empty;
                SqlParameter[] _objectSqlParmeters    = null;
                try
                {
                    _objectSqlParmeters    = new SqlParameter[1];
                    _objectSqlParmeters[0] = new SqlParameter("@ClientId", SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.Client.ClientId);
                    SqlHelper.FillDataset(Connection.ConnectionString, CommandType.StoredProcedure, "ssp_SCGetCurrentDiagnosis", CurrentDiagnosis, new string[] { "DocumentDiagnosisCodes", "DocumentDiagnosis" }, _objectSqlParmeters);
                    if (CurrentDiagnosis != null)
                    {
                        //PreviousDiagnosisString = PreviosDiagnosis.GetXml().ToString();
                        literalHtmlText.Text = CurrentDiagnosis.GetXml().ToString();
                    }
                }
                finally
                {
                    if (CurrentDiagnosis != null)
                    {
                        CurrentDiagnosis.Dispose();
                    }
                    _objectSqlParmeters = null;
                }
                literalEnd.Text = "###EndCurrentDiagnosisUc###";
                PanelLoadUC.Controls.Add(literalStart);
                PanelLoadUC.Controls.Add(literalHtmlText);
                PanelLoadUC.Controls.Add(literalEnd);
            }
        }
Пример #17
0
    protected void Page_Load(object sender, EventArgs e)

    {
        functionName = Request.Form["action"].ToString();
        switch (functionName.Trim())
        {
        case "getProblemSpan":
            DataSet datasetProblemSpan = null;
            datasetProblemSpan = SHS.BaseLayer.BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Copy();
            string[] service = (from pc in datasetProblemSpan.Tables["CustomPsychiatricNoteProblems"].AsEnumerable()
                                select getProblemCount(pc.Field <int>("PsychiatricNoteProblemId").ToString())
                                ).ToArray();
            string serviceHtml = string.Join("", service);
            Response.Clear();
            Response.Write(serviceHtml.Trim());
            Response.End();
            break;

        case "bindProblems":
            int PsychiatricServiceNoteProblemId = 0;
            int.TryParse(Request.Form["PsychiatricNoteSubjectiveId"].ToString(), out PsychiatricServiceNoteProblemId);
            Response.Clear();
            Response.Write(PsychiatricServiceNoteProblemId.ToString().Trim());
            Response.End();
            break;

        case "LoadVitals":
            DataSet Vitals = new DataSet();
            Vitals = dataSetGetVitals();
            Response.Write(Vitals.Tables["CustomDocumentPsychiatricServiceNoteExams"].Rows[0]["VitalsCurrent"].ToString() + "#8#2#3$" + Vitals.Tables["CustomDocumentPsychiatricServiceNoteExams"].Rows[0]["VitalsPrevious"].ToString() + "#8#2#3$" + Vitals.Tables["CustomDocumentPsychiatricServiceNoteExams"].Rows[0]["ThirdPreviousVitals"].ToString() + "#8#2#3$" + Vitals.Tables["CustomDocumentPsychiatricServiceNoteExams"].Rows[0]["CurreentVitalDate"].ToString() + "#8#2#3$" + Vitals.Tables["CustomDocumentPsychiatricServiceNoteExams"].Rows[0]["PreviousVitalDate"].ToString() + "#8#2#3$" + Vitals.Tables["CustomDocumentPsychiatricServiceNoteExams"].Rows[0]["ThirdPreviousVitalDate"].ToString());
            Response.End();
            break;

        case "GetMedications":
            string MedicationsString = "";
            MedicationsString = getMedicationsString();
            Response.Clear();
            Response.Write(MedicationsString);
            Response.End();
            break;

        case "GetDisconMedications":
            string DisconMedicationsString = "";
            DisconMedicationsString = getNonMedicationsString();
            Response.Clear();
            Response.Write(DisconMedicationsString);
            Response.End();
            //DataSet DisconMedicationsString = new DataSet();
            //DisconMedicationsString = getNonMedicationsString();
            //StringWriter sw = new StringWriter();
            //DisconMedicationsString.WriteXml(sw);
            //string discontinued = sw.ToString();
            //Response.Clear();
            //Response.Write(discontinued);
            //Response.End();
            break;

        case "LoadAllergirs":
            DataSet Allergies = new DataSet();
            Allergies = dataSetGetAllergies();
            StringWriter sw1 = new StringWriter();
            Allergies.WriteXml(sw1);
            string resultPIE1 = sw1.ToString();
            Response.Write(resultPIE1);
            Response.End();
            break;

        case "UpdateDiagnosis":
            string DiagnosisString = string.Empty;
            DiagnosisString = Convert.ToString(Request.Form["DiagnosisText"]);
            string[] diagResult;
            string[] stringSeparator = new string[] { "$$$" };
            diagResult = DiagnosisString.Split(stringSeparator, StringSplitOptions.None);
            string ICD10Code   = diagResult[0];
            string Description = diagResult[1];
            string ICD9Code    = diagResult[2];
            int    ICD10CodeId = Convert.ToInt32(diagResult[4]);
            int    SeverityId  = Convert.ToInt32(diagResult[6]);
            string Substance   = string.Empty;
            Substance = Convert.ToString(Request.Form["SourceSubstance"]);
            AddDiagnosis(ICD10Code, ICD9Code, ICD10CodeId, Description, Substance, SeverityId);
            CurrentDataSet objectCoutComeList = new CurrentDataSet();
            DataSet        ds_ScreenDataset   = BaseCommonFunctions.GetScreenInfoDataSet();
            objectCoutComeList.AutoSaveXml = ds_ScreenDataset.GetXml();
            Response.Clear();
            Response.Write(new JavaScriptSerializer().Serialize(objectCoutComeList));
            Response.End();
            break;

        case "RemoveDiagnosis":
            Substance = Convert.ToString(Request.Form["SourceSubstance"]);
            RemoveDiagnosis(Substance);
            CurrentDataSet objectCoutComeList1 = new CurrentDataSet();
            DataSet        ds_ScreenDataset1   = BaseCommonFunctions.GetScreenInfoDataSet();
            objectCoutComeList1.AutoSaveXml = ds_ScreenDataset1.GetXml();
            Response.Clear();
            Response.Write(new JavaScriptSerializer().Serialize(objectCoutComeList1));
            Response.End();
            break;

        case "VitalsCheck":
            var    DateOfService  = Convert.ToString(Request.Form["DateOfService"]);
            int    ServiceId      = Convert.ToInt32(Request.Form["ServiceId"]);
            string strVitalsCheck = "";
            strVitalsCheck = VitalsCheck(DateOfService, ServiceId);
            Response.Clear();
            Response.Write(strVitalsCheck);
            Response.End();
            break;

        default:
            break;
        }
    }