private string GetPatientAdherenceBarriers(int ptn_pk, int visitPK, int locationId)
        {
            string result = string.Empty;

            try
            {
                IPatientAdherence ipatientadherence;
                ipatientadherence = (IPatientAdherence)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientAdherence, BusinessProcess.Clinical");
                PatientAdherenceBarrier patientadherencebarrier = ipatientadherence.GetPatientAdherenceBarriers(ptn_pk, visitPK, locationId);

                result = SerializerUtil.ConverToJson <PatientAdherenceBarrier>(patientadherencebarrier);
            }
            catch (Exception ex)
            {
                string str = "ptn_pk: " + ptn_pk.ToString() + ",visitPK: " + visitPK.ToString() + ",locationId:" + locationId.ToString();
                CLogger.WriteLog(ELogLevel.ERROR, "GetPatientAdherenceBarriers() exception: " + str + "-" + ex.ToString());
                ResponseType response = new ResponseType()
                {
                    Success = EnumUtil.GetEnumDescription(Success.False)
                };
                result = SerializerUtil.ConverToJson <ResponseType>(response);
            }
            finally
            {
            }
            return(result);
        }
        private string SavePatientAdherenceBarriersData(string nodeJson, int ptn_pk, int visitPK, int locationId, int userId)
        {
            string       result      = string.Empty;
            ResponseType ObjResponse = new ResponseType();

            try
            {
                PatientAdherenceBarrier patientadherencebarrier = SerializerUtil.ConverToObject <PatientAdherenceBarrier>(nodeJson);
                IPatientAdherence       ipatientadherence;
                ipatientadherence = (IPatientAdherence)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPatientAdherence, BusinessProcess.Clinical");
                patientadherencebarrier.Ptn_Pk     = ptn_pk;
                patientadherencebarrier.Visit_Id   = visitPK;
                patientadherencebarrier.LocationId = locationId;

                //result = SerializerUtil.ConverToJson<Triage>(triage);
                bool flag = true;
                int  visitId;
                flag = ipatientadherence.SaveUpdatePatientAdherenceBarriers(patientadherencebarrier, userId, out visitId);


                Session["PatientVisitId"] = visitId.ToString();
                this.hidVId.Value         = visitId.ToString();

                if (flag)
                {
                    ObjResponse.Success = EnumUtil.GetEnumDescription(Success.True);
                }
                else
                {
                    ObjResponse.Success = EnumUtil.GetEnumDescription(Success.False);
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.ToLower().Contains("visit already exists"))
                {
                    ObjResponse.ErrorMessage = ex.Message;
                }
                ObjResponse.Success = EnumUtil.GetEnumDescription(Success.False);
                CLogger.WriteLog(ELogLevel.ERROR, "SavePatientAdherenceBarriersData() exception: " + ex.ToString());
            }
            finally
            {
            }

            result = SerializerUtil.ConverToJson <ResponseType>(ObjResponse);
            return(result);
        }
Esempio n. 3
0
        public bool SaveUpdatePatientAdherenceBarriers(PatientAdherenceBarrier obj, int userId, out int visitId)
        {
            CLogger.WriteLog(ELogLevel.INFO, "BPatientAdherence.SaveUpdatePatientAdherenceBarriers() method called");
            bool flag = true;

            visitId = 0;
            ClsObject clsObjTP = new ClsObject();

            try
            {
                this.Connection      = DataMgr.GetConnection();
                this.Transaction     = DataMgr.BeginTransaction(this.Connection);
                clsObjTP.Connection  = this.Connection;
                clsObjTP.Transaction = this.Transaction;

                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, obj.Ptn_Pk.ToString());
                ClsUtility.AddParameters("@Visit_Id", SqlDbType.Int, obj.Visit_Id.ToString());
                ClsUtility.AddParameters("@Location_Id", SqlDbType.Int, obj.LocationId.ToString());
                ClsUtility.AddParameters("@AcceptedHIVStatus", SqlDbType.Int, obj.AcceptedHIVStatus.ToString());
                ClsUtility.AddParameters("@IsAgeAppropriate", SqlDbType.Int, obj.IsAgeAppropriate.ToString());
                ClsUtility.AddParameters("@RiskOfTransmission", SqlDbType.Int, obj.RiskOfTransmission.ToString());
                ClsUtility.AddParameters("@UnderstandART", SqlDbType.Int, obj.UnderstandART.ToString());
                ClsUtility.AddParameters("@ARTSideEffect", SqlDbType.Int, obj.ARTSideEffect.ToString());
                ClsUtility.AddParameters("@AdherenceBenefits", SqlDbType.Int, obj.AdherenceBenefits.ToString());
                ClsUtility.AddParameters("@ConsequencesNonAdherence", SqlDbType.Int, obj.ConsequencesNonAdherence.ToString());
                ClsUtility.AddParameters("@TypicalDay", SqlDbType.VarChar, obj.TypicalDay.ToString());
                ClsUtility.AddParameters("@MedicinesIntake", SqlDbType.VarChar, obj.MedicinesIntake.ToString());
                ClsUtility.AddParameters("@TravelVisitDescription", SqlDbType.VarChar, obj.TravelVisitDescription.ToString());
                ClsUtility.AddParameters("@PrimartCareGiver", SqlDbType.VarChar, obj.PrimartCareGiver.ToString());
                ClsUtility.AddParameters("@LiveWith", SqlDbType.VarChar, obj.LiveWith.ToString());
                ClsUtility.AddParameters("@HIVStatusArtDiscussion", SqlDbType.VarChar, obj.HIVStatusArtDiscussion.ToString());
                ClsUtility.AddParameters("@SupportSystem", SqlDbType.Int, obj.SupportSystem.ToString());
                ClsUtility.AddParameters("@SupportSystemDetails", SqlDbType.VarChar, obj.SupportSystemDetails.ToString());
                ClsUtility.AddParameters("@ChangesInRelationship", SqlDbType.VarChar, obj.ChangesInRelationship.ToString());
                ClsUtility.AddParameters("@HIVStatusBotherDetails", SqlDbType.VarChar, obj.HIVStatusBotherDetails.ToString());
                ClsUtility.AddParameters("@PeopleTreatmentDetails", SqlDbType.VarChar, obj.PeopleTreatmentDetails.ToString());
                ClsUtility.AddParameters("@StigmaInterfering", SqlDbType.VarChar, obj.StigmaInterfering.ToString());
                ClsUtility.AddParameters("@ReligiousBeliefs", SqlDbType.VarChar, obj.ReligiousBeliefs.ToString());
                ClsUtility.AddParameters("@ReferredOtherServices", SqlDbType.Int, obj.ReferredOtherServices.ToString());
                ClsUtility.AddParameters("@AppointmentsAttend", SqlDbType.Int, obj.AppointmentsAttend.ToString());
                ClsUtility.AddParameters("@ExperienceAppointReorganized", SqlDbType.VarChar, obj.ExperienceAppointReorganized.ToString());
                ClsUtility.AddParameters("@UserId", SqlDbType.Int, userId.ToString());

                DataTable ReturnDT = new DataTable();

                ReturnDT = (DataTable)clsObjTP.ReturnObject(ClsUtility.theParams, "Pr_Adherence_UpdatePatientAdherenceBarriers", ClsDBUtility.ObjectEnum.DataTable);

                DataMgr.CommitTransaction(this.Transaction);
                DataMgr.ReleaseConnection(this.Connection);
                visitId = (int)ReturnDT.Rows[0]["VisitId"];
                if (visitId > 0)
                {
                    flag = true;
                }
                else
                {
                    flag = false;
                }
            }
            catch (Exception ex)
            {
                flag = false;
                CLogger.WriteLog(ELogLevel.ERROR, "BPatientAdherence.SaveUpdatePatientAdherenceBarriers() Method:" + ex.ToString());
                throw ex;
            }
            finally
            {
                clsObjTP = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
            return(flag);
        }
Esempio n. 4
0
        public PatientAdherenceBarrier GetPatientAdherenceBarriers(int ptn_pk, int visitPK, int locationId)
        {
            CLogger.WriteLog(ELogLevel.INFO, "BPatientAdherence.GetPatientAdherenceBarriers() Method Called.");
            PatientAdherenceBarrier patientadherencebarrier = new PatientAdherenceBarrier();
            ClsObject clsObjTP = new ClsObject();

            try
            {
                DataTable dt = new DataTable();
                ClsUtility.Init_Hashtable();
                ClsUtility.AddParameters("@Ptn_pk", SqlDbType.Int, ptn_pk.ToString());
                ClsUtility.AddParameters("@Visit_Id", SqlDbType.Int, visitPK.ToString());
                ClsUtility.AddParameters("@Locationid", SqlDbType.Int, locationId.ToString());

                dt = (DataTable)clsObjTP.ReturnObject(ClsUtility.theParams, "Pr_Adherence_GetPatientAdherenceBarriers", ClsDBUtility.ObjectEnum.DataTable);

                if (dt.Rows.Count > 0)
                {
                    //string.IsNullOrEmpty(dt.Rows[0]["UserId"].ToString()) == false ? Convert.ToInt32(dt.Rows[0]["UserId"].ToString()) : 0;
                    patientadherencebarrier.PAM_Id = string.IsNullOrEmpty(dt.Rows[0]["PAM_Id"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["PAM_Id"].ToString()) : 0;

                    patientadherencebarrier.Ptn_Pk = string.IsNullOrEmpty(dt.Rows[0]["Ptn_pk"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["Ptn_pk"].ToString()) : 0;

                    patientadherencebarrier.Visit_Id = string.IsNullOrEmpty(dt.Rows[0]["Visit_Id"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["Visit_Id"].ToString()) : 0;

                    patientadherencebarrier.LocationId = string.IsNullOrEmpty(dt.Rows[0]["Location_Id"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["Location_Id"].ToString()) : 0;

                    patientadherencebarrier.AcceptedHIVStatus = string.IsNullOrEmpty(dt.Rows[0]["AcceptedHIVStatus"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["AcceptedHIVStatus"].ToString()) : 0;

                    patientadherencebarrier.IsAgeAppropriate = string.IsNullOrEmpty(dt.Rows[0]["IsAgeAppropriate"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["IsAgeAppropriate"].ToString()) : 0;

                    patientadherencebarrier.RiskOfTransmission = string.IsNullOrEmpty(dt.Rows[0]["RiskOfTransmission"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["RiskOfTransmission"].ToString()) : 0;

                    patientadherencebarrier.UnderstandART = string.IsNullOrEmpty(dt.Rows[0]["UnderstandART"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["UnderstandART"].ToString()) : 0;

                    patientadherencebarrier.ARTSideEffect = string.IsNullOrEmpty(dt.Rows[0]["ARTSideEffect"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["ARTSideEffect"].ToString()) : 0;

                    patientadherencebarrier.AdherenceBenefits = string.IsNullOrEmpty(dt.Rows[0]["AdherenceBenefits"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["AdherenceBenefits"].ToString()) : 0;

                    patientadherencebarrier.ConsequencesNonAdherence = string.IsNullOrEmpty(dt.Rows[0]["ConsequencesNonAdherence"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["ConsequencesNonAdherence"].ToString()) : 0;

                    patientadherencebarrier.TypicalDay             = dt.Rows[0]["TypicalDay"].ToString();
                    patientadherencebarrier.MedicinesIntake        = dt.Rows[0]["MedicinesIntake"].ToString();
                    patientadherencebarrier.TravelVisitDescription = dt.Rows[0]["TravelVisitDescription"].ToString();
                    patientadherencebarrier.PrimartCareGiver       = dt.Rows[0]["PrimartCareGiver"].ToString();
                    patientadherencebarrier.LiveWith = dt.Rows[0]["LiveWith"].ToString();
                    patientadherencebarrier.HIVStatusArtDiscussion = dt.Rows[0]["HIVStatusArtDiscussion"].ToString();
                    patientadherencebarrier.SupportSystem          = string.IsNullOrEmpty(dt.Rows[0]["SupportSystem"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["SupportSystem"].ToString()) : 0;

                    patientadherencebarrier.SupportSystemDetails   = dt.Rows[0]["SupportSystemDetails"].ToString();
                    patientadherencebarrier.ChangesInRelationship  = dt.Rows[0]["ChangesInRelationship"].ToString();
                    patientadherencebarrier.HIVStatusBotherDetails = dt.Rows[0]["HIVStatusBotherDetails"].ToString();
                    patientadherencebarrier.PeopleTreatmentDetails = dt.Rows[0]["PeopleTreatmentDetails"].ToString();
                    patientadherencebarrier.StigmaInterfering      = dt.Rows[0]["StigmaInterfering"].ToString();
                    patientadherencebarrier.ReligiousBeliefs       = dt.Rows[0]["ReligiousBeliefs"].ToString();
                    patientadherencebarrier.ReferredOtherServices  = string.IsNullOrEmpty(dt.Rows[0]["ReferredOtherServices"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["ReferredOtherServices"].ToString()) : 0;

                    patientadherencebarrier.AppointmentsAttend = string.IsNullOrEmpty(dt.Rows[0]["AppointmentsAttend"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["AppointmentsAttend"].ToString()) : 0;

                    patientadherencebarrier.ExperienceAppointReorganized = dt.Rows[0]["ExperienceAppointReorganized"].ToString();
                    patientadherencebarrier.Total = string.IsNullOrEmpty(dt.Rows[0]["Total"].ToString()) == false?Convert.ToInt32(dt.Rows[0]["Total"].ToString()) : 0;

                    patientadherencebarrier.DepressionSeverity = dt.Rows[0]["DepressionSeverity"].ToString();
                    patientadherencebarrier.Recommended        = dt.Rows[0]["Recommended"].ToString();

                    /*
                     * patientadherencebarrier = (from row in dt.AsEnumerable()
                     *                         select new PatientAdherenceBarrier()
                     *  {
                     *      PAM_Id = row.Field<int>("PAM_Id"),
                     *      Ptn_Pk = row.Field<int>("Ptn_pk"),
                     *      Visit_Id = row.Field<int>("Visit_Id"),
                     *      LocationId = row.Field<int>("Location_Id"),
                     *
                     *      AcceptedHIVStatus = row.Field<int>("AcceptedHIVStatus"),
                     *      IsAgeAppropriate = row.Field<int>("IsAgeAppropriate"),
                     *      RiskOfTransmission = row.Field<int>("RiskOfTransmission"),
                     *      UnderstandART = row.Field<int>("UnderstandART"),
                     *      ARTSideEffect = row.Field<int>("ARTSideEffect"),
                     *      AdherenceBenefits = row.Field<int>("AdherenceBenefits"),
                     *      ConsequencesNonAdherence = row.Field<int>("ConsequencesNonAdherence"),
                     *      TypicalDay = row.Field<string>("TypicalDay"),
                     *      MedicinesIntake = row.Field<string>("MedicinesIntake"),
                     *      TravelVisitDescription = row.Field<string>("TravelVisitDescription"),
                     *      PrimartCareGiver = row.Field<string>("PrimartCareGiver"),
                     *      LiveWith = row.Field<string>("LiveWith"),
                     *      HIVStatusArtDiscussion = row.Field<string>("HIVStatusArtDiscussion"),
                     *      SupportSystem = row.Field<int?>("SupportSystem"),
                     *      SupportSystemDetails = row.Field<string>("SupportSystemDetails"),
                     *      ChangesInRelationship = row.Field<string>("ChangesInRelationship"),
                     *      HIVStatusBotherDetails = row.Field<string>("HIVStatusBotherDetails"),
                     *      PeopleTreatmentDetails = row.Field<string>("PeopleTreatmentDetails"),
                     *      StigmaInterfering = row.Field<string>("StigmaInterfering"),
                     *      ReligiousBeliefs = row.Field<string>("ReligiousBeliefs"),
                     *      ReferredOtherServices = row.Field<int?>("ReferredOtherServices"),
                     *      AppointmentsAttend = row.Field<int?>("AppointmentsAttend"),
                     *      ExperienceAppointReorganized = row.Field<string>("ExperienceAppointReorganized"),
                     *      Total = row.Field<int>("Total"),
                     *      DepressionSeverity = row.Field<string>("DepressionSeverity"),
                     *      Recommended = row.Field<string>("Recommended")
                     *  }).FirstOrDefault();
                     *
                     */
                }
            }
            catch (Exception ex)
            {
                CLogger.WriteLog(ELogLevel.ERROR, "BPatientAdherence.GetPatientAdherenceBarriers() Method:" + ex.ToString());
            }
            finally
            {
                clsObjTP = null;
                if (this.Connection != null)
                {
                    DataMgr.ReleaseConnection(this.Connection);
                }
            }
            return(patientadherencebarrier);
        }