Ejemplo n.º 1
0
        /// <summary>
        /// Log that a user exported data to an excel file
        /// </summary>
        /// <param name="disease">disease or service the data is relevant to if applicable</param>
        /// <param name="purpose">data exploration, research data analysis, operations data analysis</param>
        /// <param name="identified">does the data contain identifiers</param>
        /// <param name="isIRBApproved">is the export approved by the IRB</param>
        public static void LogUserExport(string disease, string purpose, bool identified, bool isIRBApproved)
        {
            UserExport userExport = new UserExport();

            // need to get User Login Id
            string userLoginId = System.Web.HttpContext.Current.Session[SessionKey.LoginId].ToString();

            string privacyLevel = "Identified";
            string irbApproval  = "No";

            if (isIRBApproved)
            {
                irbApproval = "Yes";
            }

            if (identified == false)
            {
                privacyLevel = "Deidentified";
            }

            userExport[UserExport.DiseaseType] = disease;
            userExport[UserExport.ExportDate]  = DateTime.Now;
            //userExport[UserExport.IRB_ApprovalDate] = irbApprovalDate;
            userExport[UserExport.IRB_ApprovalType] = irbApproval;
            userExport[UserExport.PrivacyLevel]     = privacyLevel;
            userExport[UserExport.Purpose]          = purpose;
            userExport[UserExport.UserLoginId]      = userLoginId;

            userExport.Save();
        }
Ejemplo n.º 2
0
        protected void EndExport(UserExport biz)
        {
            // v4 DataRow dr = biz.Tables[UserExport.Table_UserExport].Rows[0];
            UserExportPatientsDa tmp = new UserExportPatientsDa();

            if (((string)biz["privacyLevel"]).Equals("Identified"))
            {
                tmp.DeleteRecords(exportUserId.ToString());
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="exportType"></param>
        /// <param name="reportName"></param>
        public static void LogReportExport(string exportType, string reportName)
        {
            UserExport biz         = new UserExport();
            string     userLoginId = System.Web.HttpContext.Current.Session[SessionKey.LoginId].ToString();

            biz[UserExport.UserLoginId] = userLoginId;
            biz[UserExport.ExportDate]  = DateTime.Now;
            biz[UserExport.ExportType]  = exportType;
            biz[UserExport.ExportName]  = reportName;
            biz.Save();
        }
Ejemplo n.º 4
0
        protected int LogUserExport(UserExport biz)
        {
            // v4
            //UserExportDa da = new UserExportDa();
            //DataRow dr = biz.Tables[0].Rows[0];
            //int userExportId = da.InsertRecord(dr);
            //dr[UserExport.UserExportId] = userExportId;
            //return userExportId;

            biz.Save();
            return((int)biz[biz.PrimaryKeyName]);
        }
Ejemplo n.º 5
0
        protected BusinessObject GetParams()
        {
            UserExport biz = new UserExport();

            biz[UserExport.DiseaseType]      = Request.Form["diseaseRadio"];
            biz[UserExport.PrivacyLevel]     = Request.Form["privacyRadio"];
            biz[UserExport.IRB_ApprovalDate] = PageUtil.ObjToDateTime(Request.Form["approvalDate"]);
            biz[UserExport.IRB_ApprovalType] = Request.Form["approvalTypeRadio"];
            biz[UserExport.Purpose]          = Request.Form["purposeRadio"];
            biz[UserExport.UserLoginId]      = (int)Session[SessionKey.LoginId];
            biz[UserExport.ExportDate]       = DateTime.Now;

            biz.Save();

            return(biz);
        }
Ejemplo n.º 6
0
        public HttpResponseMessage Export([FromBody] UserSearchFilter filter)
        {
            ThrowIfUserHasNoRole(exportRole);
            if (filter != null)
            {
                filter.PageSize = 1000000;
            }

            string accessType = "User_ViewAll";

            ThrowIfUserHasNoRole(accessType);
            //if (filter == null)
            //    throw new KairosException("Missing search filter parameter");
            UserExport userExport = new UserExport();

            return(userExport.Export(Db, "UserUpload", filter));
        }
Ejemplo n.º 7
0
        public ActionResult ExportUsers()
        {
            if (ModelState.IsValid)
            {
                var export = new UserExport();
                //string sConn = ConfigurationManager.ConnectionStrings["export2csvConn"].ToString();

                export.ExportCsv();


                //db.Users.Add(user);
                //db.SaveChanges();
                //return RedirectToAction("Index");
            }

            return(Redirect("/Donors")); //View(db.Users.ToList());
        }
Ejemplo n.º 8
0
        protected void InitExport(UserExport biz, string datasetSql, ArrayList selectedTableNames)
        {
            DataView view = new UserExport[] { biz }.AsDataView();

            //this.ValidatePrivacyLevel(biz.DataSourceView.Table);
            this.ValidatePrivacyLevel(view.Table);

            selectedTables = ConvertNamesToTables(selectedTableNames);
            this.AddParentTables(selectedTables);

            exportUserId = this.LogUserExport(biz);

            this.SetNewDBName(exportUserId);

            //DataRow dr = biz.Tables[UserExport.Table_UserExport].Rows[0];
            UserExportPatientsDa tmp = new UserExportPatientsDa();

            tmp.CreateTable(datasetSql, exportUserId);
        }
Ejemplo n.º 9
0
 virtual public object GetDataExport(UserExport biz, string datasetSql, ArrayList selectedTableNames)
 {
     return(null);
 }