コード例 #1
0
ファイル: PrEP.aspx.cs プロジェクト: uon-crissp/IQCare
        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);
        }
コード例 #2
0
        private string GetCIFData(int PatientId)
        {
            string      result   = string.Empty;
            IQCareUtils theUtils = new IQCareUtils();
            ICommonData iComm    = (ICommonData)ObjectFactory.CreateInstance("BusinessProcess.Service.BCommonData, BusinessProcess.Service");

            try
            {
                IHTSClientIntake clientIntake;
                clientIntake = (IHTSClientIntake)ObjectFactory.CreateInstance("BusinessProcess.Clinical.BHTSClientIntake, BusinessProcess.Clinical");
                HTSClientIntake CI = clientIntake.GetClientIntakeFormData(PatientId, 0);

                DataView  theCodeDV = new DataView(iComm.getAllProvinceByCountry(160));
                DataTable theCodeDT = theUtils.CreateTableFromDataView(theCodeDV);

                if (theCodeDT.Rows.Count > 0)
                {
                    foreach (DataRow row in theCodeDT.Rows)
                    {
                        States st = new States();
                        st.StateID   = Convert.ToInt32(row["ID"].ToString());
                        st.StateName = row["Name"].ToString();
                        CI.AllStates.Add(st);
                    }
                }

                theCodeDV = new DataView(iComm.getAllDistrict());
                theCodeDT = theUtils.CreateTableFromDataView(theCodeDV);

                if (theCodeDT.Rows.Count > 0)
                {
                    foreach (DataRow row in theCodeDT.Rows)
                    {
                        LGAs lg = new LGAs();
                        lg.LgaID   = Convert.ToInt32(row["ID"].ToString());
                        lg.LgaName = row["Name"].ToString();
                        CI.AllLGAs.Add(lg);
                    }
                }

                theCodeDV = new DataView(iComm.getAllEmployees());
                theCodeDT = theUtils.CreateTableFromDataView(theCodeDV);

                if (theCodeDT.Rows.Count > 0)
                {
                    foreach (DataRow row in theCodeDT.Rows)
                    {
                        UserDesignation ug = new UserDesignation();
                        ug.UserID   = Convert.ToInt32(row["UserID"].ToString());
                        ug.UserName = row["UserName"].ToString();
                        CI.UserList.Add(ug);
                    }
                }

                result = SerializerUtil.ConverToJson <HTSClientIntake>(CI);
            }
            catch (Exception ex)
            {
                CLogger.WriteLog(ELogLevel.ERROR, "GetClientIntakeFormData() exception: " + ex.ToString());
                ResponseType response = new ResponseType()
                {
                    Success = EnumUtil.GetEnumDescription(Success.False)
                };
                result = SerializerUtil.ConverToJson <ResponseType>(response);
            }
            return(result);
        }
コード例 #3
0
        private string GetManagementData(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 <CodeDeCodeTables> collections = new List <CodeDeCodeTables>();

                DataView theCodeDV = new DataView(theDSXML.Tables["MST_CODE"]);
                theCodeDV.RowFilter = "DeleteFlag=0 and Name in ('ShortTermEffects','LongTermEffects','RememberingMedications','KeyPopulation','ARV Eligibility')";
                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 <CodeDeCodeTables> collections1 = new List <CodeDeCodeTables>();


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

                        collections.AddRange(collections1);
                    }
                }

                IClinicalEncounter clinicalencounter = (IClinicalEncounter)ObjectFactory.CreateInstance("HIVCE.BusinessLayer.BLClinicalEncounter, HIVCE.BusinessLayer");
                HIVCE.Common.Entities.Management obj = clinicalencounter.GetManagement(ptn_pk, visitPK, locationId);

                if (obj.DropdownValues.Count > 0)
                {
                    if (collections.Count > 0)
                    {
                        obj.DropdownValues.AddRange(collections);
                    }
                }

                theCodeDV = new DataView(oCommonData.getAllEmployees());
                theCodeDT = (DataTable)theUtils.CreateTableFromDataView(theCodeDV);
                theDT     = new DataTable();
                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());

                        obj.Signature.Add(ud);
                    }
                }
                result = SerializerUtil.ConverToJson <HIVCE.Common.Entities.Management>(obj);
            }
            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);
        }