예제 #1
0
        private string GetPrEPInitiation(int ptn_pk, int visitPK, int locationId)
        {
            string result = string.Empty;

            try
            {
                IPrEP ipatientPrEP;
                ipatientPrEP = (IPrEP)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPrEP, BusinessProcess.Clinical");
                Entities.Common.PrEP patientPrEP = ipatientPrEP.GetPrEPInitiationData(ptn_pk, visitPK, locationId);
                //PrEP patientPrEP = ipatientPrEP.GetPrEPInitiationData(ptn_pk, visitPK, locationId);

                result = SerializerUtil.ConverToJson <Entities.Common.PrEP>(patientPrEP);
            }
            catch (Exception ex)
            {
                string str = "ptn_pk: " + ptn_pk.ToString() + ",visitPK: " + visitPK.ToString() + ",locationId:" + locationId.ToString();
                CLogger.WriteLog(ELogLevel.ERROR, "GetPrEPInitiation() exception: " + str + "-" + ex.ToString());
                ResponseType response = new ResponseType()
                {
                    Success = EnumUtil.GetEnumDescription(Success.False)
                };
                result = SerializerUtil.ConverToJson <ResponseType>(response);
            }
            finally
            {
            }
            return(result);
        }
예제 #2
0
        private string GetPrEPAssessment(int ptn_pk, int visitPK, int locationId)
        {
            string result = string.Empty;

            try
            {
                IPrEP iPrep = (IPrEP)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPrEP, BusinessProcess.Clinical");
                Entities.Common.PrEP assessment = iPrep.GetPrEPAssessmentData(ptn_pk, visitPK, locationId);
                result = SerializerUtil.ConverToJson <Entities.Common.PrEP>(assessment);

                //if (visitPK > 0)
                //{

                //    IPrEP iPrep = (IPrEP)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPrEP, BusinessProcess.Clinical");
                //    Entities.Common.PrEP assessment = iPrep.GetPrEPAssessmentData(ptn_pk, visitPK, locationId);
                //    result = SerializerUtil.ConverToJson<Entities.Common.PrEP>(assessment);

                //}
                //else
                //{
                //    ResponseType response = new ResponseType() { Success = EnumUtil.GetEnumDescription(Success.False) };
                //    result = SerializerUtil.ConverToJson<ResponseType>(response);
                //}
            }
            catch (Exception ex)
            {
                ///CLogger.WriteLog(ELogLevel.ERROR, "GetAnnouncements() exception: " + ex.ToString());
                ResponseType response = new ResponseType()
                {
                    Success = EnumUtil.GetEnumDescription(Success.False)
                };
                result = SerializerUtil.ConverToJson <ResponseType>(response);
            }
            finally
            {
            }
            return(result);
        }
예제 #3
0
        private string GetFacilities(int ptn_pk, int visitPK, int locationId)
        {
            string result = string.Empty;

            try
            {
                if (object.Equals(Session["FacilityList"], string.Empty))
                {
                    IPrEP iPrepFacility      = (IPrEP)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPrEP, BusinessProcess.Clinical");
                    Entities.Common.PrEP pfl = iPrepFacility.GetPrEPTriageData(ptn_pk, visitPK, locationId);


                    string facilitylist = SerializerUtil.ConverToJson <List <Entities.Common.Facility> >(pfl.FacilityList);

                    Session["FacilityList"] = facilitylist;
                    result = facilitylist;
                }
                else
                {
                    result = Session["FacilityList"].ToString();
                }
            }
            catch (Exception ex)
            {
                CLogger.WriteLog(ELogLevel.ERROR, "GetPrEPFacility() exception: " + ex.ToString());
                ResponseType response = new ResponseType()
                {
                    Success = EnumUtil.GetEnumDescription(Success.False)
                };
                result = SerializerUtil.ConverToJson <ResponseType>(response);
            }
            finally
            {
            }
            return(result);
        }
예제 #4
0
        private string GetZScoreDetails(int ptn_pk, int visitPK, int locationId)
        {
            string result = string.Empty;

            try
            {
                IPrEP iPrepFacility     = (IPrEP)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPrEP, BusinessProcess.Clinical");
                Entities.Common.PrEP pz = iPrepFacility.GetPrEPTriageData(ptn_pk, visitPK, locationId);

                DataSet         zscoreds = new DataSet();
                IKNHStaticForms knhs     = (IKNHStaticForms)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BKNHStaticForms, BusinessProcess.Clinical");
                string          height   = string.IsNullOrEmpty(pz.PatientVitals.Height) == true ? "0" : pz.PatientVitals.Height;
                zscoreds = knhs.GetZScoreNewImplementation(ptn_pk, Session["patientsex"].ToString(), height.ToString());

                ZScoreDetails zs = new ZScoreDetails();
                zs.WFA  = new ZScore();
                zs.WFH  = new ZScore();
                zs.BMIz = new ZScore();
                if (zscoreds.Tables[0].Rows.Count > 0)
                {
                    DataColumnCollection columns = zscoreds.Tables[0].Columns;
                    if (columns.Contains("L"))
                    {
                        zs.WFA.L = Convert.ToDouble(zscoreds.Tables[0].Rows[0]["L"].ToString());
                        zs.WFA.M = Convert.ToDouble(zscoreds.Tables[0].Rows[0]["M"].ToString());
                        zs.WFA.S = Convert.ToDouble(zscoreds.Tables[0].Rows[0]["S"].ToString());
                    }
                }

                if (zscoreds.Tables[1].Rows.Count > 0)
                {
                    DataColumnCollection columns = zscoreds.Tables[1].Columns;
                    if (columns.Contains("L"))
                    {
                        zs.WFH.L = Convert.ToDouble(zscoreds.Tables[1].Rows[0]["L"].ToString());
                        zs.WFH.M = Convert.ToDouble(zscoreds.Tables[1].Rows[0]["M"].ToString());
                        zs.WFH.S = Convert.ToDouble(zscoreds.Tables[1].Rows[0]["S"].ToString());
                    }
                }

                if (zscoreds.Tables[2].Rows.Count > 0)
                {
                    DataColumnCollection columns = zscoreds.Tables[2].Columns;
                    if (columns.Contains("L"))
                    {
                        zs.BMIz.L = Convert.ToDouble(zscoreds.Tables[2].Rows[0]["L"].ToString());
                        zs.BMIz.M = Convert.ToDouble(zscoreds.Tables[2].Rows[0]["M"].ToString());
                        zs.BMIz.S = Convert.ToDouble(zscoreds.Tables[2].Rows[0]["S"].ToString());
                    }
                }

                zscoreds.Dispose();

                result = SerializerUtil.ConverToJson <Entities.Common.ZScoreDetails>(zs);
            }
            catch (Exception ex)
            {
                CLogger.WriteLog(ELogLevel.ERROR, "getzscoredetails() exception: " + ex.ToString());
                ResponseType response = new ResponseType()
                {
                    Success = EnumUtil.GetEnumDescription(Success.False)
                };
                result = SerializerUtil.ConverToJson <ResponseType>(response);
            }
            finally
            {
            }
            return(result);
        }
예제 #5
0
        private string GetPrEPTriage(int ptn_pk, int visitPK, int locationId)
        {
            string result = string.Empty;

            try
            {
                IQCareUtils theUtils = new IQCareUtils();
                DataSet     theDSXML = new DataSet();
                theDSXML.ReadXml(MapPath("..\\XMLFiles\\AllMasters.con"));
                double            age         = Convert.ToDouble(Session["patientageinyearmonth"].ToString());
                List <CodeDeCode> collections = new List <CodeDeCode>();

                DataView theCodeDV = new DataView(theDSXML.Tables["MST_CODE"]);
                theCodeDV.RowFilter = "DeleteFlag=0 and Name in ('KeyPopulation')";
                DataTable theCodeDT = (DataTable)theUtils.CreateTableFromDataView(theCodeDV);
                DataTable theDT     = new DataTable();
                if (theCodeDT.Rows.Count > 0)
                {
                    foreach (DataRow row in theCodeDT.Rows)
                    {
                        DataView theDV = new DataView(theDSXML.Tables["MST_DECODE"]);
                        theDV.RowFilter = "DeleteFlag=0 and CodeID=" + row["CodeId"] + "";

                        theDT = (DataTable)theUtils.CreateTableFromDataView(theDV);
                        List <CodeDeCode> collections1 = new List <CodeDeCode>();
                        collections1 = (from dt in theDT.AsEnumerable()
                                        select new CodeDeCode()
                        {
                            CodeId = dt.Field <int>("codeid"),
                            CodeName = dt.Field <string>("CodeName"),
                            DeCodeId = dt.Field <int>("Id"),
                            DeCodeName = dt.Field <string>("NAME")
                        }).ToList();

                        collections.AddRange(collections1);
                    }
                }

                IPrEP iPrep = (IPrEP)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BPrEP, BusinessProcess.Clinical");
                Entities.Common.PrEP prep = iPrep.GetPrEPTriageData(ptn_pk, visitPK, locationId);
                if (collections.Count > 0)
                {
                    prep.DropDownValues.AddRange(collections);
                }

                theCodeDV = new DataView(oCommonData.getAllEmployees());
                theCodeDT = (DataTable)theUtils.CreateTableFromDataView(theCodeDV);
                if (theCodeDT.Rows.Count > 0)
                {
                    foreach (DataRow row in theCodeDT.Rows)
                    {
                        UserDesignation ud = new UserDesignation();
                        ud.UserID      = Convert.ToInt32(row["userid"].ToString());
                        ud.UserName    = row["UserName"].ToString();
                        ud.Designation = row["Designation"].ToString();
                        ud.DeleteFlag  = Convert.ToInt32(row["DeleteFlag"].ToString());

                        prep.UserDesignation.Add(ud);
                    }
                }

                string facilitylist = SerializerUtil.ConverToJson <List <Entities.Common.Facility> >(prep.FacilityList);
                Session["FacilityList"] = facilitylist;

                result = SerializerUtil.ConverToJson <Entities.Common.PrEP>(prep);
            }
            catch (Exception ex)
            {
                CLogger.WriteLog(ELogLevel.ERROR, "GetPrEPTriageData() exception: " + ex.ToString());
                ResponseType response = new ResponseType()
                {
                    Success = EnumUtil.GetEnumDescription(Success.False)
                };
                result = SerializerUtil.ConverToJson <ResponseType>(response);
            }
            finally
            {
            }
            return(result);
        }