Esempio n. 1
0
    private void getLabDropDownList()
    {
        SqlParameter[] _objectSqlParmeters;
        DataSet        dataSetLabOrders = new DataSet();

        try
        {
            _objectSqlParmeters    = new SqlParameter[1];
            _objectSqlParmeters[0] = new SqlParameter("@ClientID", BaseCommonFunctions.ApplicationInfo.Client.ClientId);
            SqlHelper.FillDataset(Connection.ConnectionString, CommandType.StoredProcedure, "csp_getLabOrders", dataSetLabOrders, new string[] { "LabOrders" }, _objectSqlParmeters);
            if (dataSetLabOrders != null && dataSetLabOrders.Tables.Count > 0)
            {
                if (dataSetLabOrders.Tables.Contains("LabOrders") && BaseCommonFunctions.CheckRowExists(dataSetLabOrders, "LabOrders", 0))
                {
                    DataView dataviewLabOrders = new DataView(dataSetLabOrders.Tables["LabOrders"]);
                    DropDownList_CustomDocumentPsychiatricServiceNoteMDMs_LabsSelected.DataSource     = dataviewLabOrders;
                    DropDownList_CustomDocumentPsychiatricServiceNoteMDMs_LabsSelected.DataTextField  = "OrderName";
                    DropDownList_CustomDocumentPsychiatricServiceNoteMDMs_LabsSelected.DataValueField = "ClientOrderId";
                    DropDownList_CustomDocumentPsychiatricServiceNoteMDMs_LabsSelected.DataBind();
                    DropDownList_CustomDocumentPsychiatricServiceNoteMDMs_LabsSelected.Items.Insert(0, new ListItem("", ""));
                    DropDownList_CustomDocumentPsychiatricServiceNoteMDMs_LabsSelected.SelectedIndex = -1;
                }
            }
        }
        finally
        {
            if (dataSetLabOrders != null)
            {
                dataSetLabOrders.Dispose();
            }
            _objectSqlParmeters = null;
        }
    }
Esempio n. 2
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);
        }
    }
Esempio n. 3
0
    private void getLabOrderList()
    {
        SqlParameter[] _objectSqlParmeters;
        DataSet        dataSetLabOrders = new DataSet();

        try
        {
            _objectSqlParmeters    = new SqlParameter[1];
            _objectSqlParmeters[0] = new SqlParameter("@ClientID", BaseCommonFunctions.ApplicationInfo.Client.ClientId);
            SqlHelper.FillDataset(Connection.ConnectionString, CommandType.StoredProcedure, "csp_getLabOrdersPsycNote", dataSetLabOrders, new string[] { "LabOrders" }, _objectSqlParmeters);
            if (dataSetLabOrders != null && dataSetLabOrders.Tables.Count > 0)
            {
                if (dataSetLabOrders.Tables.Contains("LabOrders") && BaseCommonFunctions.CheckRowExists(dataSetLabOrders, "LabOrders", 0))
                {
                    DataView dataviewLabOrders = new DataView(dataSetLabOrders.Tables["LabOrders"]);
                    ClientOrderId = dataSetLabOrders.Tables["LabOrders"].Columns["ClientOrderId"].ToString();
                    GridViewLaborders.DataSource = dataviewLabOrders;
                    GridViewLaborders.DataBind();
                }
            }
        }
        finally
        {
            if (dataSetLabOrders != null)
            {
                dataSetLabOrders.Dispose();
            }
            _objectSqlParmeters = null;
        }
    }
Esempio n. 4
0
        /// <summary>
        /// <Author>Rohit Katoch</Author>
        /// <CreatedOn>24th-June-2011</CreatedOn>
        /// <Description>To remove the tables from dataset which need not be saved</Description>
        /// </summary>
        /// <param name="dataSetObject"></param>
        public override void ChangeDataSetBeforeUpdate(ref DataSet dataSetObject)
        {
            if (dataSetObject.Tables.Contains("CurrentDiagnoses"))
            {
                dataSetObject.Tables.Remove("CurrentDiagnoses");
            }
            if (dataSetObject.Tables.Contains("CustomTPQuickObjectives"))
            {
                dataSetObject.Tables.Remove("CustomTPQuickObjectives");
            }
            if (dataSetObject.Tables.Contains("CustomTPGlobalQuickGoals"))
            {
                dataSetObject.Tables.Remove("CustomTPGlobalQuickGoals");
            }
            if (dataSetObject.Tables.Contains("CustomTPGlobalQuickTransitionPlans"))
            {
                dataSetObject.Tables.Remove("CustomTPGlobalQuickTransitionPlans");
            }

            if (BaseCommonFunctions.CheckRowExists(dataSetObject, "CustomTPObjectives", 0))
            {
                DataRow[] drTPObjectives = dataSetObject.Tables["CustomTPObjectives"].Select();
                foreach (DataRow row in drTPObjectives)
                {
                    if (row["Status"].ToString() == "")
                    {
                        row["Status"] = 1;
                    }
                }
            }

            // dataSetObject.Tables["CustomTPServices"].Rows[0]["AuthorizationCodeId"]

            if (BaseCommonFunctions.CheckRowExists(dataSetObject, "CustomTPServices", 0))
            {
                DataRow[] drDeletedTPServices = dataSetObject.Tables["CustomTPServices"].Select("isnull(RecordDeleted,'N')='Y' and TPServiceId>0 and isnull(AuthorizationCodeId,-1)=-1");
                foreach (DataRow drTPServices in drDeletedTPServices)
                {
                    if ((drTPServices.RowState == DataRowState.Modified)) //&& Convert.ToString(drTPServices["RecordDeleted"]) == "Y" && (drTPServices["AuthorizationCodeId"]==DBNull.Value || Convert.ToInt32(drTPServices["AuthorizationCodeId"])<=0))
                    {
                        //if (Convert.ToInt32(drTPServices["TPServiceId"]) > 0 && drTPServices.RowState == DataRowState.Modified)
                        //{
                        drTPServices["AuthorizationCodeId"] = drTPServices["AuthorizationCodeId", DataRowVersion.Original];
                        //}
                    }
                }

                DataRow[] dataRowTPServices = dataSetObject.Tables["CustomTPServices"].Select("TPServiceId<=0 and isnull(AuthorizationCodeId,-1)=-1 and isnull(RecordDeleted,'N')='Y'");
                int       i = 0;
                while (i < dataRowTPServices.Length)
                {
                    dataSetObject.Tables["CustomTPServices"].Rows.Remove(dataRowTPServices[i]);
                    i++;
                }
            }
        }
Esempio n. 5
0
 public override void BindControls()
 {
     FillEventsDropDown();
     if (BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet != null)
     {
         if (BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet, "CustomDocumentEventInformations", 0))
         {
             DataRow dataRowEvent = BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomDocumentEventInformations"].Rows[0];
             HiddenFieldDocumentVersionId.Value = Convert.ToString(dataRowEvent["DocumentVersionId"]);
             DataRow dataRowDocument = BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["Documents"].Rows[0];
         }
     }
 }
Esempio n. 6
0
        public override void BindControls()
        {
            //Added by Sonia with Reference to ticket
            //460 7.3 - Dx Tab: Tab does not stay disabled when DxTabDisabled = 'Y'
            if (BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet, "CustomHRMAssessments", 0) == true)
            {
                if (BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomHRMAssessments"].Rows[0]["DxTabDisabled"] != null && BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomHRMAssessments"].Rows[0]["DxTabDisabled"].ToString() == "Y")
                {
                    BaseCustomGrid obj = (BaseCustomGrid)UserControl_UCDiagnosis.FindControl("CustomGrid");
                    obj.DoNotDisplayDeleteImage = true;
                }
            }

            UserControl_UCDiagnosis.Activate();
        }
Esempio n. 7
0
    /// <summary>
    /// <Created By>Sanjay Bhardwaj</Created>
    /// <Purpose>TO Add a New ROI</Purpose>
    /// </summary>
    public void AddNewCentraWellnessROI()
    {
        using (DataSet dataSetDocument = SHS.BaseLayer.BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet)
        {
            int CustomDocumentReleaseOfInformationId = 0;

            DataTable datatableROIs = dataSetDocument.Tables["CustomDocumentReleaseOfInformations"];
            DataRow   datarowNewROI = datatableROIs.NewRow();
            if (BaseCommonFunctions.CheckRowExists(datatableROIs, 0))
            {
                //This is used to maintain the ROI Primary Key and Document Version ID.
                CustomDocumentReleaseOfInformationId = Convert.ToInt32(datatableROIs.Rows[datatableROIs.Rows.Count - 1]["ReleaseOfInformationId"]);
                if (CustomDocumentReleaseOfInformationId < 0)
                {
                    datarowNewROI["ReleaseOfInformationId"] = CustomDocumentReleaseOfInformationId + Convert.ToInt16("-1");
                }
                else
                {
                    datarowNewROI["ReleaseOfInformationId"] = "-1";
                }
                datarowNewROI["DocumentVersionId"] = Convert.ToInt32(datatableROIs.Rows[datatableROIs.Rows.Count - 1]["DocumentVersionId"]);
            }
            else
            {
                datarowNewROI["ReleaseOfInformationId"] = "-1";
                datarowNewROI["DocumentVersionId"]      = "-1";
            }
            //This is used to maintain the ROI order.
            int minROIId = 1;
            minROIId = Convert.ToInt32(datatableROIs.Compute("Min(ReleaseOfInformationOrder)", "ReleaseOfInformationOrder>0"));
            if (minROIId < 1)
            {
                datarowNewROI["ReleaseOfInformationOrder"] = "1";
            }
            else
            {
                datarowNewROI["ReleaseOfInformationOrder"] = Convert.ToInt32(datatableROIs.Compute("Max(ReleaseOfInformationOrder)", "ISNULL(RecordDeleted,'N')<>'Y'")) + 1;
            }

            datarowNewROI["ReleaseEndDate"] = DateTime.Now.AddYears(1).ToString("MM/dd/yyyy");
            BaseCommonFunctions.InitRowCredentials(datarowNewROI);
            datatableROIs.Rows.Add(datarowNewROI);


            SetResponseOnAddROI(datatableROIs, Convert.ToInt64(datarowNewROI["ReleaseOfInformationId"]), Convert.ToInt64(datarowNewROI["ReleaseOfInformationOrder"]));
        }
    }
Esempio n. 8
0
    /// <summary>
    ///<Author>Jagdeep Hundal</Author>
    ///<CreatedOn>July 20,2011</CreatedOn>
    /// </summary>
    /// <param name="dataSetObject"></param>
    public override void ChangeDataSetBeforeUpdate(ref DataSet dataSetObject)
    {
        string[] dataTables = new string[] { "DiagnosesIANDIIMaxOrder" };

        //Added defensive code to avoid error in any case if audit columns like CreatedBy, CreatedDate, ModifiedBy and ModifiedDate are Null in ServiceDiagnosis table. Ref: #802 A Renewed Mind - Support.
        if (dataSetObject != null)
        {
            if (BaseCommonFunctions.CheckRowExists(dataSetObject, "ServiceDiagnosis", 0))
            {
                for (int i = 0; i < dataSetObject.Tables["ServiceDiagnosis"].Rows.Count; i++)
                {
                    if (String.IsNullOrEmpty(dataSetObject.Tables["ServiceDiagnosis"].Rows[i]["CreatedBy"].ToString()))
                    {
                        dataSetObject.Tables["ServiceDiagnosis"].Rows[i]["CreatedBy"] = BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserCode;
                    }
                    if (String.IsNullOrEmpty(dataSetObject.Tables["ServiceDiagnosis"].Rows[i]["CreatedDate"].ToString()))
                    {
                        dataSetObject.Tables["ServiceDiagnosis"].Rows[i]["CreatedDate"] = DateTime.Now;
                    }
                    if (String.IsNullOrEmpty(dataSetObject.Tables["ServiceDiagnosis"].Rows[i]["ModifiedBy"].ToString()))
                    {
                        dataSetObject.Tables["ServiceDiagnosis"].Rows[i]["ModifiedBy"] = BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserCode;
                    }
                    if (String.IsNullOrEmpty(dataSetObject.Tables["ServiceDiagnosis"].Rows[i]["ModifiedDate"].ToString()))
                    {
                        dataSetObject.Tables["ServiceDiagnosis"].Rows[i]["ModifiedDate"] = DateTime.Now;
                    }
                }
            }
        }

        if (dataSetObject != null)
        {
            for (int count = 0; count < dataTables.Length; count++)
            {
                if (dataSetObject.Tables.Contains(dataTables[count]) == true)
                {
                    dataSetObject.Tables.Remove(dataTables[count].ToString());
                }
            }
        }
        else
        {
            throw new ApplicationException("DataSet is Null");
        }
    }
Esempio n. 9
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);
                }
            }
        }
    }
Esempio n. 10
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();
            }
        }
    }
    public override void BindControls()
    {
        CustomAssessmentTransferServicesGrid.Bind(ParentDetailPageObject.ScreenId);
        CustomGridAssessmentReferrals.Bind(ParentDetailPageObject.ScreenId);

        DataTable datatableGlobalCodes = null;
        DataTable datatableStaff       = null;
        DataView  dataViewStaff        = null;
        DataTable datatableService     = null;
        DataView  dataViewService      = null;

        try
        {
            if (SHS.BaseLayer.SharedTables.ApplicationSharedTables.Staff != null)
            {
                //Bind Receiving Staff Dropdowns for Referral and Transfer
                datatableStaff          = SHS.BaseLayer.SharedTables.ApplicationSharedTables.Staff;
                dataViewStaff           = datatableStaff.DefaultView;
                dataViewStaff.Sort      = "StaffName";
                dataViewStaff.RowFilter = "Active='Y'";
                //DataView dataViewStaff = SHS.BaseLayer.SharedTables.GetSharedTableStaff();
                //dataViewStaff.RowFilter = "Active='Y'";
                //dataViewStaff.Sort = "StaffName";

                DropDownList_CustomDocumentAssessmentReferrals_ReceivingStaffId.DataTextField  = "StaffName";
                DropDownList_CustomDocumentAssessmentReferrals_ReceivingStaffId.DataValueField = "StaffId";
                DropDownList_CustomDocumentAssessmentReferrals_ReceivingStaffId.DataSource     = dataViewStaff;
                DropDownList_CustomDocumentAssessmentReferrals_ReceivingStaffId.DataBind();
                DropDownList_CustomDocumentAssessmentReferrals_ReceivingStaffId.Items.Insert(0, new ListItem("", ""));
                DropDownList_CustomDocumentAssessmentReferrals_ReceivingStaffId.SelectedIndex = 0;

                DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingStaff.DataTextField  = "StaffName";
                DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingStaff.DataValueField = "StaffId";
                DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingStaff.DataSource     = dataViewStaff;
                DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingStaff.DataBind();
                DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingStaff.Items.Insert(0, new ListItem("", ""));
            }
            //Modifed By : Amit Kumar Srivastava, #1979, Harbor Go Live Issues, SPECIFICATION: Fill Receiving Program Drop-Down Dyanmically
            //Bind Program and Frequency Dropdowns for Referral and Transfer
            datatableGlobalCodes = SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes;
            //DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingProgram.DataTableGlobalCodes = datatableGlobalCodes;
            //DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingProgram.FillDropDownDropGlobalCodes();

            DropDownList_CustomDocumentAssessmentReferrals_ServiceFrequency.DataTableGlobalCodes = datatableGlobalCodes;
            DropDownList_CustomDocumentAssessmentReferrals_ServiceFrequency.FillDropDownDropGlobalCodes();

            //Bind Service Dropdowns for Referral and Transfer
            //datatableService = SHS.BaseLayer.SharedTables.ApplicationSharedTables.AuthorizationCodes;
            //dataViewService = datatableService.DefaultView;
            //DropDownList_CustomDocumentAssessmentTransferServices_TransferService.DataTextField = "AuthorizationCodeName";
            //DropDownList_CustomDocumentAssessmentTransferServices_TransferService.DataValueField = "AuthorizationCodeId";
            //DropDownList_CustomDocumentAssessmentTransferServices_TransferService.DataSource = dataViewService;
            //DropDownList_CustomDocumentAssessmentTransferServices_TransferService.DataBind();
            //DropDownList_CustomDocumentAssessmentTransferServices_TransferService.Items.Insert(0, new ListItem("", ""));
            //DropDownList_CustomDocumentAssessmentTransferServices_TransferService.SelectedIndex = 0;

            //DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.DataTextField = "AuthorizationCodeName";
            //DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.DataValueField = "AuthorizationCodeId";
            //DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.DataSource = dataViewService;
            //DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.DataBind();
            //DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.Items.Insert(0, new ListItem("", ""));
            //DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.SelectedIndex = 0;

            //Service
            //Modify by :RohitK,on 06-19-2012,1796,#81 Services Drop-Downs,Harbor Go Live Issues
            //This stored procedure is designed to restrict the authorization codes available based on DocumentCodeId and ClientId
            using (SHS.UserBusinessServices.ReferralService objectReferralService = new SHS.UserBusinessServices.ReferralService())
            {
                int      DocumentCodeId          = Convert.ToInt32(BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet, "Documents") ? BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["Documents"].Rows[0]["DocumentCodeId"] : 0);
                DataSet  datasetReferralService  = objectReferralService.GetReferralService(DocumentCodeId, Convert.ToInt32(BaseCommonFunctions.ApplicationInfo.Client.ClientId));
                DataView dataViewReferralService = new DataView(datasetReferralService.Tables["AuthorizationCodes"]);
                DropDownList_CustomDocumentAssessmentTransferServices_TransferService.DataTextField  = "DisplayAs";
                DropDownList_CustomDocumentAssessmentTransferServices_TransferService.DataValueField = "AuthorizationCodeId";
                DropDownList_CustomDocumentAssessmentTransferServices_TransferService.DataSource     = dataViewReferralService;
                DropDownList_CustomDocumentAssessmentTransferServices_TransferService.DataBind();
                DropDownList_CustomDocumentAssessmentTransferServices_TransferService.Items.Insert(0, new ListItem("", ""));
                DropDownList_CustomDocumentAssessmentTransferServices_TransferService.SelectedIndex = 0;

                DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.DataTextField  = "DisplayAs";
                DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.DataValueField = "AuthorizationCodeId";
                DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.DataSource     = dataViewReferralService;
                DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.DataBind();
                DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.Items.Insert(0, new ListItem("", ""));
                DropDownList_CustomDocumentAssessmentReferrals_ServiceRecommended.SelectedIndex = 0;
            }
            //Below Code Added by Maninder (7/9/2012): Task#2007 in Harbor Go Live
            if (BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet, "CustomDocumentDiagnosticAssessments", 0) && BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomDocumentDiagnosticAssessments"].Rows[0]["TransferReceivingStaff"] != DBNull.Value)
            {
                int TransferReceivingStaff = 0;
                TransferReceivingStaff = Convert.ToInt32(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomDocumentDiagnosticAssessments"].Rows[0]["TransferReceivingStaff"]);
                using (SHS.UserBusinessServices.DiagnosticAssessment objDiagnosticAssessment = new SHS.UserBusinessServices.DiagnosticAssessment())
                {
                    DataSet DataSetRecProgramByReceivingStaff = objDiagnosticAssessment.RecProgramByReceivingStaff(TransferReceivingStaff);
                    if (BaseCommonFunctions.CheckRowExists(DataSetRecProgramByReceivingStaff, "RecProgramByReceivingStaff", 0) != null)
                    {
                        DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingProgram.DataTextField  = "ProgramCode";
                        DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingProgram.DataValueField = "Programid";
                        DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingProgram.DataSource     = DataSetRecProgramByReceivingStaff.Tables["RecProgramByReceivingStaff"];
                        DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingProgram.DataBind();
                        DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingProgram.Items.Insert(0, new ListItem("", ""));
                        DropDownList_CustomDocumentDiagnosticAssessments_TransferReceivingProgram.SelectedIndex = 0;
                    }
                }
            }
            //Ends
        }
        finally
        {
            if (datatableGlobalCodes != null)
            {
                datatableGlobalCodes.Dispose();
            }
            if (datatableService != null)
            {
                datatableService.Dispose();
            }
            if (datatableStaff != null)
            {
                datatableStaff.Dispose();
            }
        }
    }
        public void Bind_Control_Expires()
        {
            if (SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes != null)
            {
                //DropDownList_CustomDocumentTransfers_LevelofCare binding
                DataView dataLevelofCare = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataLevelofCare.RowFilter = "Category='XLEVELOFCARE' AND Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                dataLevelofCare.Sort      = "CodeName";
                //DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                DropDownList_CustomDocumentTransfers_LevelofCare.DataTextField  = "CodeName";
                DropDownList_CustomDocumentTransfers_LevelofCare.DataValueField = "GlobalCodeId";
                DropDownList_CustomDocumentTransfers_LevelofCare.DataSource     = dataLevelofCare;
                DropDownList_CustomDocumentTransfers_LevelofCare.DataBind();

                //Referring status
                DataView dataRefStatus = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataRefStatus.RowFilter = "Category='REFERRALSTATUS' AND Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                dataRefStatus.Sort      = "CodeName";
                //DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                DropDownList_CustomDocumentTransfers_TransferStatus.DataTextField  = "CodeName";
                DropDownList_CustomDocumentTransfers_TransferStatus.DataValueField = "GlobalCodeId";
                DropDownList_CustomDocumentTransfers_TransferStatus.DataSource     = dataRefStatus;
                DropDownList_CustomDocumentTransfers_TransferStatus.DataBind();
                if (SetIndex == true)
                {
                    DropDownList_CustomDocumentTransfers_TransferStatus.SelectedIndex = 1;
                }
                //Referral staff
                ///Staff
                DataRow[] DataRowStaff   = SHS.BaseLayer.SharedTables.ApplicationSharedTables.Staff.Select("Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'");
                DataTable dataTableStaff = new DataTable("Table");
                dataTableStaff.Columns.Add("StaffID", System.Type.GetType("System.Int32"));
                dataTableStaff.Columns.Add("StaffName", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("StaffCode", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("clinician", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("adminstaff", System.Type.GetType("System.String"));
                DataRow dataRowObject = dataTableStaff.NewRow();
                string  signerName    = string.Empty;

                //For All Staff User
                for (int counter1 = 0; counter1 < DataRowStaff.Length; counter1++)
                {
                    dataRowObject            = dataTableStaff.NewRow();
                    dataRowObject["StaffID"] = DataRowStaff[counter1]["StaffId"];
                    signerName = Convert.ToString(DataRowStaff[counter1]["LastName"]).Trim() + ", " + Convert.ToString(DataRowStaff[counter1]["FirstName"]).Trim();
                    if (signerName.Length > 27)
                    {
                        dataRowObject["StaffName"] = signerName.Substring(0, 27) + "...";
                    }
                    else
                    {
                        dataRowObject["StaffName"] = signerName;
                    }
                    dataRowObject["StaffCode"]  = DataRowStaff[counter1]["UserCode"];
                    dataRowObject["clinician"]  = DataRowStaff[counter1]["clinician"];
                    dataRowObject["adminstaff"] = DataRowStaff[counter1]["adminstaff"];
                    dataTableStaff.Rows.Add(dataRowObject);
                }

                DataView dataViewStaff = new DataView(dataTableStaff);
                //dataViewStaff.Sort = "StaffNameID,StaffName";
                dataViewStaff.Sort = "StaffName";
                DropDownList_CustomDocumentTransfers_TransferringStaff.DataTextField  = "StaffName";
                DropDownList_CustomDocumentTransfers_TransferringStaff.DataValueField = "StaffID";
                DropDownList_CustomDocumentTransfers_TransferringStaff.DataSource     = dataViewStaff;
                DropDownList_CustomDocumentTransfers_TransferringStaff.DataBind();

                if (initilization == true)
                {
                    DropDownList_CustomDocumentTransfers_TransferringStaff.ClearSelection();
                    DropDownList_CustomDocumentTransfers_TransferringStaff.Items.FindByValue(BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserId.ToString()).Selected = true;
                    initilization = false;
                }

                //Receiving staff
                DataView dvReceivingStaff = new DataView(dataTableStaff);
                dvReceivingStaff.RowFilter = "clinician='Y' OR adminstaff='Y' ";
                dvReceivingStaff.Sort      = "StaffName";
                DropDownList_CustomDocumentTransfers_ReceivingStaff.DataTextField  = "StaffName";
                DropDownList_CustomDocumentTransfers_ReceivingStaff.DataValueField = "StaffID";
                DropDownList_CustomDocumentTransfers_ReceivingStaff.DataSource     = dvReceivingStaff;
                DropDownList_CustomDocumentTransfers_ReceivingStaff.DataBind();


                //Receiving program
                //DataView dataStaffProgram = new DataView(SHS.BaseLayer.SharedTables.StaffSharedTables.StaffProgram);
                ////DataView dataRecProgram = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                ////dataRecProgram.RowFilter = "Category='RECEIVINGPROGRAM' AND Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                //dataStaffProgram.Sort = "CodeName";
                ////DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                //DropDownList_CustomDocumentTransfers_ReceivingProgram.DataTextField = "CodeName";
                //DropDownList_CustomDocumentTransfers_ReceivingProgram.DataValueField = "GlobalCodeId";
                //DropDownList_CustomDocumentTransfers_ReceivingProgram.DataSource = dataStaffProgram;
                //DropDownList_CustomDocumentTransfers_ReceivingProgram.DataBind();

                //Service

                //DataView dataServices = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.AuthorizationCodes);
                //dataServices.RowFilter = "Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                //dataServices.Sort = "AuthorizationCodeName";
                ////DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                //DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataTextField = "AuthorizationCodeName";
                //DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataValueField = "AuthorizationCodeId";
                //DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataSource = dataServices;
                //DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataBind();
                using (SHS.UserBusinessServices.ReferralService objectReferralService = new SHS.UserBusinessServices.ReferralService())
                {
                    int      DocumentCodeId          = Convert.ToInt32(BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet, "Documents") ? BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["Documents"].Rows[0]["DocumentCodeId"] : 0);
                    DataSet  datasetReferralService  = objectReferralService.GetReferralService(DocumentCodeId, Convert.ToInt32(BaseCommonFunctions.ApplicationInfo.Client.ClientId));
                    DataView dataViewReferralService = new DataView(datasetReferralService.Tables["AuthorizationCodes"]);
                    dataViewReferralService.Sort = "DisplayAs";
                    DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataTextField  = "DisplayAs";
                    DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataValueField = "AuthorizationCodeId";
                    DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataSource     = dataViewReferralService;
                    DropDownList_CustomDocumentTransferServices_AuthorizationCodeId.DataBind();
                }

                //Receiving action
                DataView dataRecAction = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataRecAction.RowFilter = "Category='RECEIVINGACTION' AND Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                dataRecAction.Sort      = "CodeName";
                //DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                DropDownList_CustomDocumentTransfers_ReceivingAction.DataTextField  = "CodeName";
                DropDownList_CustomDocumentTransfers_ReceivingAction.DataValueField = "GlobalCodeId";
                DropDownList_CustomDocumentTransfers_ReceivingAction.DataSource     = dataRecAction;
                DropDownList_CustomDocumentTransfers_ReceivingAction.DataBind();

                //using (SHS.UserBusinessServices.DetailPages objectCpt = new SHS.UserBusinessServices.DetailPages())
                //{
                //    DataSet dstGetStaffProgeram = new DataSet();
                //   // dstGetStaffProgeram = objectCpt.GetStaffProgeram();
                //    int counter = dstGetStaffProgeram.Tables[0].Rows.Count;
                //    StringBuilder strhidden = new StringBuilder();
                //    for(int i=0;i<counter;i++)
                //    {
                //        strhidden.Append(dstGetStaffProgeram.Tables[0].Rows[i]["Program"]);
                //        strhidden.Append(",");
                //        strhidden.Append(dstGetStaffProgeram.Tables[0].Rows[i]["StaffProgramId"]);
                //        strhidden.Append("||");
                //    }


                //    hiddenProgramList.Value = strhidden.ToString();

                //    // cs.RegisterClientScriptBlock(GetType(), "BodyLoadUnloadScript", "<SCRIPT LANGUAGE='JavaScript'> alert('HAPPY CODING')</script>");


                //    //Page.ClientScript.RegisterClientScriptBlock(GetType(), "MyScript", "<script> alert('HAPPY CODING')</script>");


                //}
                using (SHS.UserBusinessServices.DetailPages objectCpt = new SHS.UserBusinessServices.DetailPages())
                {
                    DataSet dstGetcustomconfigurationsURL = new DataSet();
                    dstGetcustomconfigurationsURL = objectCpt.GetcustomconfigurationsURL();
                    if (dstGetcustomconfigurationsURL.Tables["customconfigurations"].Rows.Count > 0)
                    {
                        HyperLink_help.NavigateUrl = Convert.ToString(dstGetcustomconfigurationsURL.Tables["customconfigurations"].Rows[0][0]);
                    }
                }
            }
        }
Esempio n. 13
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();
            //            }
            //        }
            //    }
        }
    }
Esempio n. 14
0
    public override void ChangeInitializedDataSet(ref DataSet dataSetObject)
    {
        //base.ChangeInitializedDataSet(ref dataSetObject);


        int DocumentVersionId = Convert.ToInt32(dataSetObject.Tables["DocumentVersions"].Rows[0]["DocumentVersionId"].ToString());

        if (GetRequestParameterValue("AssessmentScreenType").ToString() == "U" || GetRequestParameterValue("AssessmentScreenType").Trim() == "")
        {
            return;
        }
        using (SHS.UserBusinessServices.HarborTreatmentPlan objHarborTreatmentPlan = new SHS.UserBusinessServices.HarborTreatmentPlan())
        {
            int staffId = BaseCommonFunctions.GetUserIdInCaseOfMultipleDataBase();

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


            //        //foreach (DataRow dr in dataSetObject.Tables["CustomTPGoalNeeds"].Rows)
            //        //{
            //        //    //if(Convert.ToInt32(dr[0])<0)
            //        //    dr.SetAdded();

            //        //}

            //    }
            //    //Code commented by jagdeep to remove CustomTPQuickObjectives from unsaved changes
            //    //Start
            //    //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["CustomTPGlobalQuickGoals"], 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);
            //    //    }
            //    //}

            //}

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

            if (!BaseCommonFunctions.CheckRowExists(dataSetObject, "CustomTPGoals", 0))
            {
                DataRow drCustomNeed = dataSetObject.Tables["CustomTPGoals"].NewRow();
                drCustomNeed["TPGoalId"]          = -1;
                drCustomNeed["DocumentVersionId"] = dataSetObject.Tables["DocumentVersions"].Rows[0]["DocumentVersionId"];
                drCustomNeed["GoalNumber"]        = 1;
                drCustomNeed["TargeDate"]         = DateTime.Now.AddYears(1);
                BaseCommonFunctions.InitRowCredentials(drCustomNeed);

                dataSetObject.Tables["CustomTPGoals"].Rows.Add(drCustomNeed);
            }
        }
    }
Esempio n. 15
0
        public override void BindControls()
        {
            CustomGridSupportContacts.Bind(ParentPageObject.ScreenId);
            DataTable dtCustomDocumentSafetyCrisisPlans = SHS.BaseLayer.BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomDocumentSafetyCrisisPlans"].Copy();
            DataSet   dsSafetyPlan = new DataSet();

            dsSafetyPlan = SHS.BaseLayer.BaseCommonFunctions.GetScreenInfoDataSet();
            DateTime dt = new DateTime();

            if (dsSafetyPlan.Tables["CustomSafetyCrisisPlanReviews"].Rows.Count > 0)
            {
                if (!string.IsNullOrEmpty(dsSafetyPlan.Tables["CustomSafetyCrisisPlanReviews"].Rows[0]["NextSafetyPlanReviewDate"].ToString()))
                {
                    dt = Convert.ToDateTime(dsSafetyPlan.Tables["CustomSafetyCrisisPlanReviews"].Rows[0]["NextSafetyPlanReviewDate"]);
                    NextSafetyPlanReviewDate = String.Format("{0:MM/dd/yyyy}", dt);
                    NextSafetyPlanReviewDate = "[Next Review date:" + NextSafetyPlanReviewDate + "]";
                }
            }

            string ThreeMonths  = string.Empty;
            string TwelveMonths = string.Empty;
            string mode         = string.Empty;

            if (dtCustomDocumentSafetyCrisisPlans.Rows.Count > 0)
            {
                if (!string.IsNullOrEmpty(dtCustomDocumentSafetyCrisisPlans.Rows[0]["ThreeMonths"].ToString()))
                {
                    ThreeMonths = dtCustomDocumentSafetyCrisisPlans.Rows[0]["ThreeMonths"].ToString().Trim();
                }
                if (!string.IsNullOrEmpty(dtCustomDocumentSafetyCrisisPlans.Rows[0]["TwelveMonths"].ToString()))
                {
                    TwelveMonths = dtCustomDocumentSafetyCrisisPlans.Rows[0]["TwelveMonths"].ToString().Trim();
                }

                if (TwelveMonths == "Y")
                {
                    mode = "12months";
                }
                else if (ThreeMonths == "Y")
                {
                    mode = "3months";
                }
            }

            string strFilter    = string.Empty;
            string strTodayDate = string.Empty;

            if (mode == "3months")
            {
                strTodayDate = System.DateTime.Now.AddMonths(-3).ToString("MM/dd/yyyy");
            }
            else if (mode == "12months")
            {
                strTodayDate = System.DateTime.Now.AddMonths(-12).ToString("MM/dd/yyyy");
            }
            if (strTodayDate.Trim() != string.Empty)
            {
                strFilter = "isnull(convert(DateReviewed,'System.DateTime'),'01/01/1900') >= '" + strTodayDate + "'";
            }

            if (strFilter == "")
            {
                CustomGridCustomSafetyCrisisPlanReviews.Bind(ParentPageObject.ScreenId);
            }
            else
            {
                CustomGridCustomSafetyCrisisPlanReviews.Bind(ParentPageObject.ScreenId, strFilter);
            }

            DataSet datasetSupportContacts = new DataSet();
            int     clientId = 0;

            clientId = SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.Client.ClientId;
            datasetSupportContacts = GetSupportContactsName(clientId);
            HiddenFieldClientContactInformation.Value = datasetSupportContacts.GetXml();
            if (datasetSupportContacts.Tables.Contains("ClientContactInformation") && BaseCommonFunctions.CheckRowExists(datasetSupportContacts, "ClientContactInformation", 0))
            {
                DataView dataviewSafetyPlan = new DataView(datasetSupportContacts.Tables["ClientContactInformation"]);

                DropDownList_ClientContactInformation_Name.DataSource     = dataviewSafetyPlan;
                DropDownList_ClientContactInformation_Name.DataTextField  = "Name";
                DropDownList_ClientContactInformation_Name.DataValueField = "ClientContactId";
                DropDownList_ClientContactInformation_Name.DataBind();
                DropDownList_ClientContactInformation_Name.Items.Insert(0, new ListItem("", ""));
                DropDownList_ClientContactInformation_Name.SelectedIndex = -1;
            }
        }
Esempio n. 16
0
    /// <summary>
    ///  Purpose :Binding Controls
    /// </summary>
    public override void BindControls()
    {
        //HiddenFieldRelativePath.Value = Page.ResolveUrl("~/");
        //string ROIId = base.GetRequestParameterValue("ROIId");
        //if (!string.IsNullOrEmpty(ROIId))
        //{
        //    ParentDetailPageObject.SetParentScreenProperties("ROIId", ROIId);
        //}

        DataView dvAllStates = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.States);

        dvAllStates.Sort = "StateName ASC";
        DropDownList_CustomDocumentReleaseOfInformations_ReleasedState.DataSource     = dvAllStates;
        DropDownList_CustomDocumentReleaseOfInformations_ReleasedState.DataTextField  = "StateName";
        DropDownList_CustomDocumentReleaseOfInformations_ReleasedState.DataValueField = "StateAbbreviation";
        DropDownList_CustomDocumentReleaseOfInformations_ReleasedState.DataBind();
        DropDownList_CustomDocumentReleaseOfInformations_ReleasedState.Items.Insert(0, new ListItem("", ""));

        DataSet datasetReleasedToReceiveFrom = new DataSet();
        int     clientId = 0;

        clientId = SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.Client.ClientId;
        using (SHS.UserBusinessServices.ReleaseOfInformations objectReleasedToReceiveFrom = new SHS.UserBusinessServices.ReleaseOfInformations())
        {
            datasetReleasedToReceiveFrom = objectReleasedToReceiveFrom.GetMemberContactsReleasedToReceiveFrom(clientId);
            if (datasetReleasedToReceiveFrom.Tables.Contains("TableReleasedToReceiveFrom") && BaseCommonFunctions.CheckRowExists(datasetReleasedToReceiveFrom, "TableReleasedToReceiveFrom", 0))
            {
                DataView dataviewReleaseOfInformations = new DataView(datasetReleasedToReceiveFrom.Tables["TableReleasedToReceiveFrom"]);
                DropDownList_CustomDocumentReleaseOfInformations_ReleaseToReceiveFrom.DataSource     = dataviewReleaseOfInformations;
                DropDownList_CustomDocumentReleaseOfInformations_ReleaseToReceiveFrom.DataTextField  = "Name";
                DropDownList_CustomDocumentReleaseOfInformations_ReleaseToReceiveFrom.DataValueField = "ClientContactId";
                DropDownList_CustomDocumentReleaseOfInformations_ReleaseToReceiveFrom.DataBind();
                DropDownList_CustomDocumentReleaseOfInformations_ReleaseToReceiveFrom.Items.Insert(0, new ListItem("", ""));
            }
        }
        BindROIObjectivesInfo();
    }
Esempio n. 17
0
        public override void ChangeInitializedDataSet(ref DataSet dataSetObject)
        {
            ////base.ChangeInitializedDataSet(ref dataSetObject);


            int DocumentVersionId = Convert.ToInt32(dataSetObject.Tables["DocumentVersions"].Rows[0]["DocumentVersionId"].ToString());

            using (SHS.UserBusinessServices.HarborTreatmentPlan objHarborTreatmentPlan = new SHS.UserBusinessServices.HarborTreatmentPlan())
            {
                int     staffId = BaseCommonFunctions.GetUserIdInCaseOfMultipleDataBase();
                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
                        //{
                        //    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);
                        //}


                        //foreach (DataRow dr in dataSetObject.Tables["CustomTPGoalNeeds"].Rows)
                        //{
                        //    //if(Convert.ToInt32(dr[0])<0)
                        //    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["CustomTPQuickObjectives"], 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["CustomTPGlobalQuickGoals"], 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);
                    //    }
                    //}
                }

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

                if (!BaseCommonFunctions.CheckRowExists(dataSetObject, "CustomTPGoals", 0))
                {
                    DataRow drCustomNeed = dataSetObject.Tables["CustomTPGoals"].NewRow();
                    drCustomNeed["TPGoalId"]          = -1;
                    drCustomNeed["DocumentVersionId"] = dataSetObject.Tables["DocumentVersions"].Rows[0]["DocumentVersionId"];
                    drCustomNeed["GoalNumber"]        = 1;
                    drCustomNeed["TargeDate"]         = DateTime.Now.AddYears(1);
                    BaseCommonFunctions.InitRowCredentials(drCustomNeed);

                    dataSetObject.Tables["CustomTPGoals"].Rows.Add(drCustomNeed);
                }
            }
        }
Esempio n. 18
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();
                //            }
                //        }
                //    }
            }
        }
Esempio n. 19
0
    public override void BindControls()
    {
        CustomGridPsychiatricReferrals.Bind(ParentDetailPageObject.ScreenId);
        DataTable datatableGlobalCodes       = null;
        DataTable datatableStaff             = null;
        DataView  dataViewStaff              = null;
        DataTable datatableService           = null;
        DataView  dataViewService            = null;
        DataSet   dataSetCustomConfiguration = null;

        try
        {
            SHS.UserBusinessServices.Document _documentObject = new SHS.UserBusinessServices.Document();
            dataSetCustomConfiguration = _documentObject.GetCustomConfigurtions();



            //Bind Receiving Staff Dropdowns for Referral and Transfer
            datatableStaff = SHS.BaseLayer.SharedTables.ApplicationSharedTables.Staff;
            dataViewStaff  = datatableStaff.DefaultView;
            DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ReceivingStaffId.DataTextField  = "StaffName";
            DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ReceivingStaffId.DataValueField = "StaffId";
            DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ReceivingStaffId.DataSource     = dataViewStaff;
            DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ReceivingStaffId.DataBind();
            DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ReceivingStaffId.Items.Insert(0, new ListItem("", ""));
            DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ReceivingStaffId.SelectedIndex = 0;

            //Bind Program and Frequency Dropdowns for Referral and Transfer
            datatableGlobalCodes = SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes;
            DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceFrequency.DataTableGlobalCodes = datatableGlobalCodes;
            DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceFrequency.FillDropDownDropGlobalCodes();
            //datatableService = SHS.BaseLayer.SharedTables.ApplicationSharedTables.AuthorizationCodes;
            //dataViewService = datatableService.DefaultView;
            //DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.DataTextField = "AuthorizationCodeName";
            //DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.DataValueField = "AuthorizationCodeId";
            //DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.DataSource = dataViewService;
            //DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.DataBind();
            //DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.Items.Insert(0, new ListItem("", ""));
            //DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.SelectedIndex = 0;

            //Bind Service Dropdowns for Referral and Transfer
            //Modify by :RohitK,on 06-19-2012,1796,#81 Services Drop-Downs,Harbor Go Live Issues
            //This stored procedure is designed to restrict the authorization codes available based on DocumentCodeId and ClientId
            using (SHS.UserBusinessServices.ReferralService objectReferralService = new SHS.UserBusinessServices.ReferralService())
            {
                int      DocumentCodeId          = Convert.ToInt32(BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet, "Documents") ? BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["Documents"].Rows[0]["DocumentCodeId"] : 0);
                DataSet  datasetReferralService  = objectReferralService.GetReferralService(DocumentCodeId, Convert.ToInt32(BaseCommonFunctions.ApplicationInfo.Client.ClientId));
                DataView dataViewReferralService = new DataView(datasetReferralService.Tables["AuthorizationCodes"]);
                DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.DataTextField  = "DisplayAs";
                DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.DataValueField = "AuthorizationCodeId";
                DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.DataSource     = dataViewReferralService;
                DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.DataBind();
                DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.Items.Insert(0, new ListItem("", ""));
                DropDownList_CustomDocumentPsychiatricEvaluationReferrals_ServiceRecommended.SelectedIndex = 0;
            }

            if (dataSetCustomConfiguration.Tables["customconfigurations"].Rows.Count > 0)
            {
                if (dataSetCustomConfiguration.Tables["customconfigurations"].Rows[0]["ReferralTransferReferenceURL"] != DBNull.Value)
                {
                    hiddenFieldReferralTransferReferenceURL.Value = dataSetCustomConfiguration.Tables["customconfigurations"].Rows[0]["ReferralTransferReferenceURL"].ToString();
                }
            }
        }
        finally
        {
            if (datatableGlobalCodes != null)
            {
                datatableGlobalCodes.Dispose();
            }
            if (datatableService != null)
            {
                datatableService.Dispose();
            }
            if (datatableStaff != null)
            {
                datatableStaff.Dispose();
            }
        }
    }
        private void BindControlGeneral()
        {
            if (SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes != null)
            {
                DataRow[] DataRowStaff   = SHS.BaseLayer.SharedTables.ApplicationSharedTables.Staff.Select("Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'");
                DataTable dataTableStaff = new DataTable("Table");
                dataTableStaff.Columns.Add("StaffID", System.Type.GetType("System.Int32"));
                dataTableStaff.Columns.Add("FirstName", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("LastName", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("StaffName", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("StaffCode", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("clinician", System.Type.GetType("System.String"));
                dataTableStaff.Columns.Add("adminstaff", System.Type.GetType("System.String"));

                DataRow dataRowObject = dataTableStaff.NewRow();
                string  signerName    = string.Empty;

                //For All Staff User
                for (int counter1 = 0; counter1 < DataRowStaff.Length; counter1++)
                {
                    dataRowObject            = dataTableStaff.NewRow();
                    dataRowObject["StaffID"] = DataRowStaff[counter1]["StaffId"];
                    signerName = Convert.ToString(DataRowStaff[counter1]["LastName"]).Trim() + ", " + Convert.ToString(DataRowStaff[counter1]["FirstName"]).Trim();
                    if (signerName.Length > 27)
                    {
                        dataRowObject["StaffName"] = signerName.Substring(0, 27) + "...";
                    }
                    else
                    {
                        dataRowObject["StaffName"] = signerName;
                    }
                    dataRowObject["FirstName"]  = DataRowStaff[counter1]["FirstName"];
                    dataRowObject["LastName"]   = DataRowStaff[counter1]["LastName"];
                    dataRowObject["StaffCode"]  = DataRowStaff[counter1]["UserCode"];
                    dataRowObject["clinician"]  = DataRowStaff[counter1]["clinician"];
                    dataRowObject["adminstaff"] = DataRowStaff[counter1]["adminstaff"];

                    dataTableStaff.Rows.Add(dataRowObject);
                }

                DataView dataViewStaff = new DataView(dataTableStaff);
                //dataViewStaff.Sort = "StaffNameID,StaffName";
                dataViewStaff.Sort = "StaffName";

                //Referring status
                DataView dataRefStatus = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataRefStatus.RowFilter = "Category='REFERRALSTATUS' AND Active='Y' AND ISNULL(RecordDeleted,'N')<>'Y'";
                dataRefStatus.Sort      = "SortOrder";
                DropDownList_CustomDocumentReferrals_ReferralStatus.DataTextField  = "CodeName";
                DropDownList_CustomDocumentReferrals_ReferralStatus.DataValueField = "GlobalCodeId";
                DropDownList_CustomDocumentReferrals_ReferralStatus.DataSource     = dataRefStatus;
                DropDownList_CustomDocumentReferrals_ReferralStatus.DataBind();
                if (SetIndex == true)
                {
                    DropDownList_CustomDocumentReferrals_ReferralStatus.SelectedIndex = 1;
                }
                //Referral DocumentReferrals


                DropDownList_CustomDocumentReferrals_ReferringStaff.DataTextField  = "StaffName";
                DropDownList_CustomDocumentReferrals_ReferringStaff.DataValueField = "StaffId";
                DropDownList_CustomDocumentReferrals_ReferringStaff.DataSource     = dataViewStaff;
                DropDownList_CustomDocumentReferrals_ReferringStaff.DataBind();
                if (initilization == true)
                {
                    DropDownList_CustomDocumentReferrals_ReferringStaff.ClearSelection();
                    DropDownList_CustomDocumentReferrals_ReferringStaff.Items.FindByValue(BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserId.ToString()).Selected = true;
                    initilization = false;
                }
                //Receiving DocumentReferrals

                DataView dvReceivingStaff = new DataView(dataTableStaff);
                dvReceivingStaff.RowFilter = "clinician='Y' OR adminstaff='Y' ";
                dvReceivingStaff.Sort      = "StaffName";
                DropDownList_CustomDocumentReferrals_ReceivingStaff.DataTextField  = "StaffName";
                DropDownList_CustomDocumentReferrals_ReceivingStaff.DataValueField = "StaffId";
                DropDownList_CustomDocumentReferrals_ReceivingStaff.DataSource     = dvReceivingStaff;
                DropDownList_CustomDocumentReferrals_ReceivingStaff.DataBind();

                //Receiving program
                //DataView dataRecProgram = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.Programs);
                //dataRecProgram.RowFilter = "Active='Y' AND ISNULL(RecordDeleted,'N')='N'";
                //dataRecProgram.Sort = "ProgramName";
                //DropDownList_CustomDocumentReferrals_ReceivingProgram.DataTextField = "ProgramName";
                //DropDownList_CustomDocumentReferrals_ReceivingProgram.DataValueField = "ProgramId";
                //DropDownList_CustomDocumentReferrals_ReceivingProgram.DataSource = dataRecProgram;
                //DropDownList_CustomDocumentReferrals_ReceivingProgram.DataBind();

                //DataView dataServices = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.AuthorizationCodes);
                //dataServices.RowFilter = "Active='Y' AND ISNULL(RecordDeleted,'N')='N'";
                //dataServices.Sort = "AuthorizationCodeName";
                ////DropDownList_CustomDocumentReferrals_ReferralStatus.Items.Add(new ListItem("", "-1"));
                //DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataTextField = "AuthorizationCodeName";
                //DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataValueField = "AuthorizationCodeId";
                //DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataSource = dataServices;
                //DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataBind();

                //Service
                //Modify by :RohitK,on 06-19-2012,1796,#81 Services Drop-Downs,Harbor Go Live Issues
                //This stored procedure is designed to restrict the authorization codes available based on DocumentCodeId and ClientId
                using (SHS.UserBusinessServices.ReferralService objectReferralService = new SHS.UserBusinessServices.ReferralService())
                {
                    int      DocumentCodeId          = Convert.ToInt32(BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet, "Documents") ? BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["Documents"].Rows[0]["DocumentCodeId"] : 0);
                    DataSet  datasetReferralService  = objectReferralService.GetReferralService(DocumentCodeId, Convert.ToInt32(BaseCommonFunctions.ApplicationInfo.Client.ClientId));
                    DataView dataViewReferralService = new DataView(datasetReferralService.Tables["AuthorizationCodes"]);
                    dataViewReferralService.Sort = "DisplayAs";
                    DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataTextField  = "DisplayAs";
                    DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataValueField = "AuthorizationCodeId";
                    DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataSource     = dataViewReferralService;
                    DropDownList_CustomDocumentReferralServices_AuthorizationCodeId.DataBind();
                }

                //Receiving action
                DataView dataRecAction = new DataView(SHS.BaseLayer.SharedTables.ApplicationSharedTables.GlobalCodes);
                dataRecAction.RowFilter = "Category='RECEIVINGACTION' AND Active='Y' AND ISNULL(RecordDeleted,'N')='N'";
                dataRecAction.Sort      = "SortOrder";
                DropDownList_CustomDocumentReferrals_ReceivingAction.DataTextField  = "CodeName";
                DropDownList_CustomDocumentReferrals_ReceivingAction.DataValueField = "GlobalCodeId";
                DropDownList_CustomDocumentReferrals_ReceivingAction.DataSource     = dataRecAction;
                DropDownList_CustomDocumentReferrals_ReceivingAction.DataBind();


                using (SHS.UserBusinessServices.DetailPages objectCpt = new SHS.UserBusinessServices.DetailPages())
                {
                    DataSet dstGetcustomconfigurationsURL = new DataSet();
                    dstGetcustomconfigurationsURL = objectCpt.GetcustomconfigurationsURL();
                    if (dstGetcustomconfigurationsURL != null)
                    {
                        if (dstGetcustomconfigurationsURL.Tables["customconfigurations"].Rows.Count > 0)
                        {
                            HyperLink_help.NavigateUrl = Convert.ToString(dstGetcustomconfigurationsURL.Tables["customconfigurations"].Rows[0][0]);
                        }
                    }
                }
            }
            CustomGrid.Bind(ParentDetailPageObject.ScreenId);
        }
Esempio n. 21
0
    public string getMedicationsString()
    {
        DataSet MedicationsDataSet = new DataSet();
        int     documentversionId  = -1;
        string  MedicationsString  = string.Empty;

        SqlParameter[] _objectSqlParmeters = null;

        try
        {
            if (BaseCommonFunctions.CheckRowExists(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["DocumentVersions"], 0))
            {
                documentversionId = Convert.ToInt32(BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["DocumentVersions"].Rows[0]["DocumentVersionId"]);
            }
            string DateOfService = string.Empty;
            DateOfService = Convert.ToString(Request.Form["DateOfService"]);
            if (string.IsNullOrEmpty(DateOfService) || DateOfService == "null")
            {
                DateOfService = DateTime.Now.ToShortDateString();
            }
            _objectSqlParmeters    = new SqlParameter[2];
            _objectSqlParmeters[0] = new SqlParameter("@ClientId", SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.Client.ClientId);
            _objectSqlParmeters[1] = new SqlParameter("@DateOfService", DateOfService);
            SqlHelper.FillDataset(Connection.ConnectionString, CommandType.StoredProcedure, "csp_GetPsychiatricNoteMedications", MedicationsDataSet, new string[] { "CurrentMedications", "CurrentMedicationsNotSC", "DiscontinuedMedications" }, _objectSqlParmeters);
            if (MedicationsDataSet != null)
            {
                MedicationsString = MedicationsDataSet.GetXml().ToString();
            }


            DataSet dsPPN = SHS.BaseLayer.BaseCommonFunctions.GetScreenInfoDataSet();
            if (dsPPN != null && dsPPN.Tables["CustomPsychiatricNoteMedicationHistory"] != null && dsPPN.Tables["CustomPsychiatricNoteMedicationHistory"].Rows.Count > 0)
            {
                foreach (DataRow dr in dsPPN.Tables["CustomPsychiatricNoteMedicationHistory"].Rows)
                {
                    BaseCommonFunctions.UpdateRecordDeletedInformation(dr);
                }
            }


            if (MedicationsDataSet != null && MedicationsDataSet.Tables["CurrentMedications"] != null && MedicationsDataSet.Tables["CurrentMedications"].Rows.Count > 0)
            {
                foreach (DataRow dr in MedicationsDataSet.Tables["CurrentMedications"].Rows)
                {
                    DataRow newDataRow = BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomPsychiatricNoteMedicationHistory"].NewRow();
                    newDataRow["DocumentVersionId"] = documentversionId;

                    newDataRow["ClientMedicationId"] = dr["ClientMedicationId"];
                    newDataRow["CreatedBy"]          = SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserCode;
                    newDataRow["CreatedDate"]        = DateTime.Now;
                    newDataRow["ModifiedBy"]         = SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserCode;
                    newDataRow["ModifiedDate"]       = DateTime.Now;

                    newDataRow["MedicalStatus"] = 'S';
                    BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomPsychiatricNoteMedicationHistory"].Rows.Add(newDataRow);
                }
            }
            if (MedicationsDataSet != null && MedicationsDataSet.Tables["CurrentMedicationsNotSC"] != null && MedicationsDataSet.Tables["CurrentMedicationsNotSC"].Rows.Count > 0)
            {
                foreach (DataRow dr in MedicationsDataSet.Tables["CurrentMedicationsNotSC"].Rows)
                {
                    DataRow newDataRow = BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomPsychiatricNoteMedicationHistory"].NewRow();
                    newDataRow["DocumentVersionId"]  = documentversionId;
                    newDataRow["CreatedBy"]          = SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserCode;
                    newDataRow["CreatedDate"]        = DateTime.Now;
                    newDataRow["ModifiedBy"]         = SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserCode;
                    newDataRow["ModifiedDate"]       = DateTime.Now;
                    newDataRow["ClientMedicationId"] = dr["ClientMedicationId"];
                    newDataRow["MedicalStatus"]      = 'N';
                    BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomPsychiatricNoteMedicationHistory"].Rows.Add(newDataRow);
                }
            }
            if (MedicationsDataSet != null && MedicationsDataSet.Tables["DiscontinuedMedications"] != null && MedicationsDataSet.Tables["DiscontinuedMedications"].Rows.Count > 0)
            {
                foreach (DataRow dr in MedicationsDataSet.Tables["DiscontinuedMedications"].Rows)
                {
                    DataRow newDataRow = BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomPsychiatricNoteMedicationHistory"].NewRow();
                    newDataRow["DocumentVersionId"] = documentversionId;

                    newDataRow["ClientMedicationId"] = dr["ClientMedicationId"];
                    newDataRow["CreatedBy"]          = SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserCode;
                    newDataRow["CreatedDate"]        = DateTime.Now;
                    newDataRow["ModifiedBy"]         = SHS.BaseLayer.BaseCommonFunctions.ApplicationInfo.LoggedInUser.UserCode;
                    newDataRow["ModifiedDate"]       = DateTime.Now;

                    newDataRow["MedicalStatus"] = 'D';
                    BaseCommonFunctions.ScreenInfo.CurrentDocument.DocumentDataSet.Tables["CustomPsychiatricNoteMedicationHistory"].Rows.Add(newDataRow);
                }
            }


            return(MedicationsString);
        }
        finally
        {
            if (MedicationsDataSet != null)
            {
                MedicationsDataSet.Dispose();
            }
            _objectSqlParmeters = null;
        }
    }
Esempio n. 22
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);
    }