Esempio n. 1
0
        public REFERRAL ParseReaderCustom(DataRow row)
        {
            REFERRAL objReturn = new REFERRAL
            {
                COMMENT_TEXT         = (string)GetNullableObject(row.Field <object>("REFERRAL_COMMENT_TEXT")),
                CREATED              = (DateTime)GetNullableObject(row.Field <object>("REFERRAL_CREATED")),
                CREATEDBY            = (string)GetNullableObject(row.Field <object>("REFERRAL_CREATEDBY")),
                CREATEDSOURCE        = (string)GetNullableObject(row.Field <object>("REFERRAL_CREATEDSOURCE")),
                DUPLICATE_FLAG       = (bool)GetNullableObject(row.Field <object>("REFERRAL_DUPLICATE_FLAG")),
                PATIENT_ID           = (Int32)GetNullableObject(row.Field <object>("REFERRAL_PATIENT_ID")),
                PROVIDER_ID          = (Int32?)GetNullableObject(row.Field <object>("REFERRAL_PROVIDER_ID")),
                REFERRAL_CLASS_TEXT  = (string)GetNullableObject(row.Field <object>("REFERRAL_REFERRAL_CLASS_TEXT")),
                REFERRAL_DATE        = (DateTime?)GetNullableObject(row.Field <object>("REFERRAL_REFERRAL_DATE")),
                REFERRAL_ID          = (Int32)GetNullableObject(row.Field <object>("REFERRAL_REFERRAL_ID")),
                REVIEW_BY            = (string)GetNullableObject(row.Field <object>("REFERRAL_REVIEW_BY")),
                REVIEW_DATE          = (DateTime?)GetNullableObject(row.Field <object>("REFERRAL_REVIEW_DATE")),
                STD_REFERRALSTS_ID   = (Int32)GetNullableObject(row.Field <object>("REFERRAL_STD_REFERRALSTS_ID")),
                STD_REGISTRY_ID      = (Int32)GetNullableObject(row.Field <object>("REFERRAL_STD_REGISTRY_ID")),
                STD_REMINDERCLASS_ID = (Int32?)GetNullableObject(row.Field <object>("REFERRAL_STD_REMINDERCLASS_ID")),
                UPDATED              = (DateTime)GetNullableObject(row.Field <object>("REFERRAL_UPDATED")),
                UPDATEDBY            = (string)GetNullableObject(row.Field <object>("REFERRAL_UPDATEDBY")),
                UPDATEDSOURCE        = (string)GetNullableObject(row.Field <object>("REFERRAL_UPDATEDSOURCE"))
            };

            return(objReturn);
        }
        protected void LinkSelect_Click(object sender, EventArgs e)
        {
            ServiceInterfaceManager.LogInformation("POSTBACK_EVENT", String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);

            try
            {
                LinkButton lb = (LinkButton)sender;
                if (lb != null)
                {
                    int id = 0;

                    if (int.TryParse(lb.CommandArgument, out id))
                    {
                        REFERRAL r = ServiceInterfaceManager.REFERRAL_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, id);
                        if (r != null)
                        {
                            UserSession.CurrentRegistryId = r.STD_REGISTRY_ID;
                            UserSession.CurrentReferralId = r.REFERRAL_ID;
                            UserSession.CurrentPatientId  = r.PATIENT_ID;
                            UserSession.CurrentProviderId = r.PROVIDER_ID.GetValueOrDefault();

                            Response.Redirect("~/Common/Referral.aspx", false);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ServiceInterfaceManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);
                throw ex;
            }
        }
Esempio n. 3
0
        public void LoadForm(int id)
        {
            ResetForm();

            REFERRAL referral = ServiceInterfaceManager.REFERRAL_GET_COMPLETE(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, id);

            if (referral != null)
            {
                if (referral.STD_REFERRALSTS != null)
                {
                    lblStatus.Text = referral.STD_REFERRALSTS.CODE;
                }

                if (referral.REFERRAL_DATE != null)
                {
                    lblReferralDate.Text = referral.REFERRAL_DATE.Value.ToString("MM/dd/yyyy");
                }

                lblCreatedBy.Text = referral.CREATEDBY;
                lblCreated.Text   = referral.CREATED.ToString("MM/dd/yyyy");
                lblUpdatedBy.Text = referral.UPDATEDBY;
                lblUpdated.Text   = referral.UPDATED.ToString("MM/dd/yyyy");
                lblReviewBy.Text  = referral.REVIEW_BY;

                if (referral.REVIEW_DATE != null)
                {
                    lblReviewDate.Text = referral.REVIEW_DATE.Value.ToString("MM/dd/yyyy");
                }
            }
            else
            {
                linkViewDetails.Visible = false;
            }
        }
        private bool SaveForm(int patientId, int providerId)
        {
            bool objReturn = false;

            //if (ServiceInterfaceManager.REFERRAL_PATIENT_EXISTS(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, patientId))
            //{
            //    lblResult.Text = "The selected Patient has already been added to this Registry.<br /><br />";
            //}
            //else
            //{
            int referralId = ServiceInterfaceManager.REFERRAL_SAVE_MANUAL(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, patientId, providerId);

            if (referralId > 0)
            {
                REFERRAL r = ServiceInterfaceManager.REFERRAL_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, referralId);
                if (r != null)
                {
                    UserSession.CurrentRegistryId = r.STD_REGISTRY_ID;
                    UserSession.CurrentReferralId = r.REFERRAL_ID;
                    UserSession.CurrentPatientId  = r.PATIENT_ID;
                    UserSession.CurrentProviderId = r.PROVIDER_ID.GetValueOrDefault();
                }

                objReturn = true;
            }
            else
            {
                lblResult.Text = "An error occurred while attempting to save, please try again.<br /><br />";
            }
            //}

            return(objReturn);
        }
Esempio n. 5
0
        public static Int32 Save(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, REFERRAL objSave)
        {
            Int32      objReturn = 0;
            REFERRALDB objDB     = new REFERRALDB();

            objReturn = objDB.Save(CURRENT_USER, CURRENT_REGISTRY_ID, objSave);

            return(objReturn);
        }
Esempio n. 6
0
        public static REFERRAL GetItem(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, Int32 REFERRAL_ID)
        {
            REFERRAL   objReturn = null;
            REFERRALDB objDB     = new REFERRALDB();

            objReturn = objDB.GetItem(CURRENT_USER, CURRENT_REGISTRY_ID, REFERRAL_ID);

            return(objReturn);
        }
Esempio n. 7
0
        public static Boolean CheckPatientExists(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, Int32 PATIENT_ID)
        {
            Boolean objReturn = false;
            REFERRALDB objDB = new REFERRALDB();

            REFERRAL objTemp = objDB.GetItemByRegistryPatient(CURRENT_USER, CURRENT_REGISTRY_ID, PATIENT_ID);
            if (objTemp != null)
                objReturn = true;

            return objReturn;
        }
        private void LoadForm(int id)
        {
            REFERRAL referral = ServiceInterfaceManager.REFERRAL_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, id);

            if (referral != null)
            {
                LoadPatient(referral.PATIENT_ID);
                if (referral.PROVIDER_ID != null)
                {
                    LoadProvider(referral.PROVIDER_ID.Value);
                }
            }
        }
        protected void LinkEdit_Click(object sender, EventArgs e)
        {
            ServiceInterfaceManager.LogInformation("POSTBACK_EVENT", String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);

            try
            {
                UserSession.RefreshCommon();

                LinkButton lb = (LinkButton)sender;
                if (lb != null)
                {
                    int id = 0;
                    int.TryParse(lb.CommandArgument, out id);

                    if (id > 0)
                    {
                        REFERRAL r = ServiceInterfaceManager.REFERRAL_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, id);
                        if (r != null)
                        {
                            UserSession.CurrentReferralId = r.REFERRAL_ID;
                            UserSession.CurrentPatientId  = r.PATIENT_ID;

                            if (r.PROVIDER_ID != null)
                            {
                                UserSession.CurrentProviderId = r.PROVIDER_ID.Value;
                            }

                            pnlProviders.Visible = false;
                            pnlProvider.Visible  = true;
                            LoadForm(id);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ServiceInterfaceManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);
                throw ex;
            }
        }
Esempio n. 10
0
        protected void BtnSaveDisqualifyReason_Click(object sender, EventArgs e)
        {
            ServiceInterfaceManager.LogInformation("POSTBACK_EVENT", String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);
            int referralId = 0;

            try
            {
                if (!string.IsNullOrEmpty(txtDisqualifyReason.Text.Trim()))
                {
                    STD_REFERRALSTS status = ServiceInterfaceManager.STD_REFERRALSTS_GET_BY_CODE(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, "DISQUALIFIED");
                    REFERRAL        r      = ServiceInterfaceManager.REFERRAL_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, UserSession.CurrentReferralId);

                    if (r != null && status != null)
                    {
                        r.COMMENT_TEXT       = txtDisqualifyReason.Text.Trim();
                        r.STD_REFERRALSTS_ID = status.ID;
                        referralId           = ServiceInterfaceManager.REFERRAL_SAVE(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, r);
                    }

                    if (referralId > 0)
                    {
                        lblResult.Text = "This Referral has been disqualified.<br /><br />";
                        LoadForm();
                    }
                    else
                    {
                        lblResult.Text = "An unexpected error occurred, please try again.<br /><br />";
                    }
                }
                else
                {
                    lblResult.Text = "Please enter a Disqualify Reason and try again.<br /><br />";
                }
            }
            catch (Exception ex)
            {
                ServiceInterfaceManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);
                throw ex;
            }
        }
Esempio n. 11
0
        public REFERRAL ParseReaderComplete(DataRow row)
        {
            REFERRAL objReturn = ParseReaderCustom(row);

            if (objReturn != null)
            {
                if (objReturn.STD_REFERRALSTS_ID > 0)
                {
                    STD_REFERRALSTSDB sTD_REFERRALSTSDB = new STD_REFERRALSTSDB();
                    objReturn.STD_REFERRALSTS = sTD_REFERRALSTSDB.ParseReaderCustom(row);
                }

                if (objReturn.STD_REGISTRY_ID > 0)
                {
                    STD_REGISTRYDB sTD_REGISTRYDB = new STD_REGISTRYDB();
                    objReturn.STD_REGISTRY = sTD_REGISTRYDB.ParseReaderCustom(row);
                }

                if (objReturn.PATIENT_ID > 0)
                {
                    PATIENTDB pATIENTDB = new PATIENTDB();
                    objReturn.PATIENT = pATIENTDB.ParseReaderCustom(row);

                    SPATIENTDB sPATIENTDB = new SPATIENTDB();
                    objReturn.SPATIENT = sPATIENTDB.ParseReaderCustom(row);

                    objReturn.SPATIENT.PatientLastFour = (string)GetNullableObject(row.Field <object>("SPATIENT_PatientLastFour"));
                }

                if (objReturn.PROVIDER_ID > 0)
                {
                    SStaff_SStaffDB sStaff_SStaffDB = new SStaff_SStaffDB();
                    objReturn.SStaff_SStaff = sStaff_SStaffDB.ParseReaderCustom(row);
                }
            }

            return(objReturn);
        }
Esempio n. 12
0
 public static Boolean Delete(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, REFERRAL objDelete)
 {
     return(Delete(CURRENT_USER, CURRENT_REGISTRY_ID, objDelete.REFERRAL_ID));
 }
Esempio n. 13
0
        public REFERRAL GetItem(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, Int32 REFERRAL_ID)
        {
            REFERRAL objReturn = null;

            SqlConnection  sConn    = null;
            SqlCommand     sCmd     = null;
            SqlDataAdapter sAdapter = null;
            DataSet        objTemp  = null;

            try
            {
                sConn = new SqlConnection(SqlConnectionString);

                sConn.Open();

                sCmd = new SqlCommand("CRS.usp_REFERRAL_getitem", sConn);
                sCmd.CommandTimeout = SqlCommandTimeout;
                sCmd.CommandType    = CommandType.StoredProcedure;
                sCmd.Parameters.AddWithValue("@CURRENT_USER", CURRENT_USER);
                sCmd.Parameters.AddWithValue("@CURRENT_REGISTRY_ID", CURRENT_REGISTRY_ID);
                sCmd.Parameters.AddWithValue("@REFERRAL_ID", REFERRAL_ID);

                objTemp  = new DataSet();
                sAdapter = new SqlDataAdapter(sCmd);

                LogDetails logDetails = new LogDetails(String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID);
                sAdapter.Fill(objTemp);
                LogManager.LogTiming(logDetails);
                CheckDataSet(objTemp);

                if (objTemp != null && objTemp.Tables.Count > 0 && objTemp.Tables[0].Rows.Count > 0)
                {
                    objReturn = ParseReader(objTemp.Tables[0].Rows[0]);
                }

                sConn.Close();
            }
            catch (Exception ex)
            {
                LogManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID);
                throw ex;
            }
            finally
            {
                if (sAdapter != null)
                {
                    sAdapter.Dispose();
                    sAdapter = null;
                }
                if (sCmd != null)
                {
                    sCmd.Dispose();
                    sCmd = null;
                }
                if (sConn != null)
                {
                    if (sConn.State != ConnectionState.Closed)
                    {
                        sConn.Close();
                    }
                    sConn.Dispose();
                    sConn = null;
                }
            }

            return(objReturn);
        }
Esempio n. 14
0
        public Int32 Save(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, REFERRAL objSave)
        {
            Int32 objReturn = 0;

            SqlConnection sConn = null;
            SqlCommand    sCmd  = null;
            SqlParameter  p     = null;

            try
            {
                sConn = new SqlConnection(SqlConnectionString);

                sConn.Open();

                sCmd = new SqlCommand("CRS.usp_REFERRAL_save", sConn);
                sCmd.CommandTimeout = SqlCommandTimeout;
                sCmd.CommandType    = CommandType.StoredProcedure;
                sCmd.Parameters.AddWithValue("@CURRENT_USER", CURRENT_USER);
                sCmd.Parameters.AddWithValue("@CURRENT_REGISTRY_ID", CURRENT_REGISTRY_ID);

                p           = new SqlParameter("@COMMENT_TEXT", SqlDbType.VarChar, 4000);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.COMMENT_TEXT);
                p           = new SqlParameter("@CREATED", SqlDbType.DateTime, 8);
                p.Precision = 23;
                p.Scale     = 3;
                AddParameter(ref sCmd, ref p, objSave.CREATED);
                p           = new SqlParameter("@CREATEDBY", SqlDbType.VarChar, 30);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.CREATEDBY);
                p           = new SqlParameter("@CREATEDSOURCE", SqlDbType.VarChar, 30);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.CREATEDSOURCE);
                p           = new SqlParameter("@DUPLICATE_FLAG", SqlDbType.Bit, 1);
                p.Precision = 1;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.DUPLICATE_FLAG);
                p           = new SqlParameter("@PATIENT_ID", SqlDbType.Int, 4);
                p.Precision = 10;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.PATIENT_ID);
                p           = new SqlParameter("@PROVIDER_ID", SqlDbType.Int, 4);
                p.Precision = 10;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.PROVIDER_ID);
                p           = new SqlParameter("@REFERRAL_CLASS_TEXT", SqlDbType.VarChar, 4000);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.REFERRAL_CLASS_TEXT);
                p           = new SqlParameter("@REFERRAL_DATE", SqlDbType.DateTime, 8);
                p.Precision = 23;
                p.Scale     = 3;
                AddParameter(ref sCmd, ref p, objSave.REFERRAL_DATE);
                p           = new SqlParameter("@REFERRAL_ID", SqlDbType.Int, 4);
                p.Direction = ParameterDirection.InputOutput;
                p.Precision = 10;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.REFERRAL_ID);
                p           = new SqlParameter("@REVIEW_BY", SqlDbType.VarChar, 30);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.REVIEW_BY);
                p           = new SqlParameter("@REVIEW_DATE", SqlDbType.DateTime, 8);
                p.Precision = 23;
                p.Scale     = 3;
                AddParameter(ref sCmd, ref p, objSave.REVIEW_DATE);
                p           = new SqlParameter("@STD_REFERRALSTS_ID", SqlDbType.Int, 4);
                p.Precision = 10;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.STD_REFERRALSTS_ID);
                p           = new SqlParameter("@STD_REGISTRY_ID", SqlDbType.Int, 4);
                p.Precision = 10;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.STD_REGISTRY_ID);
                p           = new SqlParameter("@STD_REMINDERCLASS_ID", SqlDbType.Int, 4);
                p.Precision = 10;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.STD_REMINDERCLASS_ID);
                p           = new SqlParameter("@UPDATED", SqlDbType.DateTime, 8);
                p.Precision = 23;
                p.Scale     = 3;
                AddParameter(ref sCmd, ref p, objSave.UPDATED);
                p           = new SqlParameter("@UPDATEDBY", SqlDbType.VarChar, 30);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.UPDATEDBY);
                p           = new SqlParameter("@UPDATEDSOURCE", SqlDbType.VarChar, 30);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.UPDATEDSOURCE);

                LogDetails logDetails = new LogDetails(String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID);
                int        cnt        = sCmd.ExecuteNonQuery();
                LogManager.LogTiming(logDetails);

                objReturn = (Int32)sCmd.Parameters["@REFERRAL_ID"].Value;

                sConn.Close();
            }
            catch (Exception ex)
            {
                LogManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID);
                throw ex;
            }
            finally
            {
                if (sCmd != null)
                {
                    sCmd.Dispose();
                    sCmd = null;
                }
                if (sConn != null)
                {
                    if (sConn.State != ConnectionState.Closed)
                    {
                        sConn.Close();
                    }
                    sConn.Dispose();
                    sConn = null;
                }
            }

            return(objReturn);
        }
Esempio n. 15
0
        private void ResetForm()
        {
            hideWorkstreamId.Value = string.Empty;

            listWorkstreamName.ClearSelection();
            listWorkstreamName.Items.Clear();

            listWorkstreamName.Enabled = true;

            List <STD_WKFCASETYPE> cases = ServiceInterfaceManager.STD_WKFCASETYPE_GET_ALL_BY_REGISTRY(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);

            listWorkstreamName.Items.Add(new ListItem("", "0"));
            listWorkstreamName.AppendDataBoundItems = true;
            if (cases != null)
            {
                listWorkstreamName.DataSource = cases;
                listWorkstreamName.DataBind();
            }

            if (UserSession.CurrentReferralId > 0)
            {
                REFERRAL r = ServiceInterfaceManager.REFERRAL_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, UserSession.CurrentReferralId);
                if (r != null)
                {
                    hideReferralId.Value = r.REFERRAL_ID.ToString();

                    if (r.REFERRAL_DATE != null)
                    {
                        txtReferralDate.Text = r.REFERRAL_DATE.Value.ToString("MM/dd/yyyy");
                    }

                    if (UserSession.CurrentPatientId <= 0)
                    {
                        UserSession.CurrentPatientId = r.PATIENT_ID;
                    }
                }
            }
            else
            {
                txtReferralDate.Text = string.Empty;
            }

            if (UserSession.CurrentPatientId > 0)
            {
                PATIENT p = ServiceInterfaceManager.PATIENT_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, UserSession.CurrentPatientId);
                if (p != null)
                {
                    hidePatientId.Value = p.PATIENT_ID.ToString();

                    if (!string.IsNullOrEmpty(p.LAST_NAME) && !string.IsNullOrEmpty(p.FIRST_NAME))
                    {
                        txtPatientName.Text = p.LAST_NAME + ", " + p.FIRST_NAME;
                    }
                    else if (!string.IsNullOrEmpty(p.LAST_NAME))
                    {
                        txtPatientName.Text = p.LAST_NAME;
                    }
                    else if (!string.IsNullOrEmpty(p.FIRST_NAME))
                    {
                        txtPatientName.Text = p.FIRST_NAME;
                    }
                }
            }
            else
            {
                txtPatientName.Text = string.Empty;
            }

            txtCaseNumber.Text    = string.Empty;
            txtCaseStartDate.Text = string.Empty;
            txtCaseDueDate.Text   = string.Empty;
        }
Esempio n. 16
0
        private void LoadForm(int id)
        {
            ResetForm();

            listWorkstreamName.Enabled = false;

            WKF_CASE workstream = ServiceInterfaceManager.WKF_CASE_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, id);

            if (workstream != null)
            {
                hideWorkstreamId.Value = workstream.WKF_CASE_ID.ToString();

                //TODO: Patient ID should not be null or 0 here, but may need to add logic
                //here at some point in case it is.
                if (workstream.PATIENT_ID > 0)
                {
                    PATIENT p = ServiceInterfaceManager.PATIENT_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, workstream.PATIENT_ID);
                    if (p != null)
                    {
                        hidePatientId.Value = p.PATIENT_ID.ToString();

                        if (!string.IsNullOrEmpty(p.LAST_NAME) && !string.IsNullOrEmpty(p.FIRST_NAME))
                        {
                            txtPatientName.Text = p.LAST_NAME + ", " + p.FIRST_NAME;
                        }
                        else if (!string.IsNullOrEmpty(p.LAST_NAME))
                        {
                            txtPatientName.Text = p.LAST_NAME;
                        }
                        else if (!string.IsNullOrEmpty(p.FIRST_NAME))
                        {
                            txtPatientName.Text = p.FIRST_NAME;
                        }
                    }
                }

                if (workstream.REFERRAL_ID != null && workstream.REFERRAL_ID > 0)
                {
                    REFERRAL r = ServiceInterfaceManager.REFERRAL_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, workstream.REFERRAL_ID.Value);
                    if (r != null)
                    {
                        hideReferralId.Value = r.REFERRAL_ID.ToString();
                        if (r.REFERRAL_DATE != null)
                        {
                            txtReferralDate.Text = r.REFERRAL_DATE.Value.ToString("MM/dd/yyyy");
                        }
                    }
                }

                foreach (ListItem li in listWorkstreamName.Items)
                {
                    if (li.Value == workstream.STD_WKFCASETYPE_ID.ToString())
                    {
                        li.Selected = true;
                        break;
                    }
                }

                txtCaseNumber.Text = workstream.CASE_NUMBER;

                if (workstream.CASE_START_DATE != null)
                {
                    txtCaseStartDate.Text = workstream.CASE_START_DATE.Value.ToString("MM/dd/yyyy");
                }

                if (workstream.CASE_DUE_DATE != null)
                {
                    txtCaseDueDate.Text = workstream.CASE_DUE_DATE.Value.ToString("MM/dd/yyyy");
                }
            }
        }