Exemple #1
0
        private void DeleteAnalysisResults(StudySettings studyMetadata)
        {
            // Delete report settings
            var study = new MappingController().LoadStudy(studyMetadata.NDAName, studyMetadata.ProfileName,
                                                          studyMetadata.SupplementNumber, studyMetadata.StudyCode);

            // Delete reports
            study.Reports          = new List <Report>();
            study.Analytes         = null;
            study.Parameters       = null;
            study.Concentration    = null;
            study.Pharmacokinetics = null;
            new MappingController().SaveStudy(study, study.NDAName, study.ProfileName, study.SupplementNumber, study.StudyCode);

            // Delete the output files
            var userName  = Users.GetCurrentUserName();
            var studyPath = string.Format(@"\\{0}\Output Files\PKView\{1}\{2}\{3}\{4}\{5}",
                                          iPortalApp.AppServerName, userName, study.ProfileName, study.NDAName, study.SupplementNumber, study.StudyCode);
            var studyFolder = new DirectoryInfo(studyPath);

            if (studyFolder.Exists)
            {
                studyFolder.Delete(true);
            }
        }
Exemple #2
0
        public int DeleteReport([FromBody] StudySettings revisedMappings, int reportId)
        {
            // Save report settings into the user study profile (FIXME: Improve profile management)
            var study = new MappingController().LoadStudy(revisedMappings.NDAName, revisedMappings.ProfileName,
                                                          revisedMappings.SupplementNumber, revisedMappings.StudyCode, null, true);
            var reportName = revisedMappings.Reports[reportId].Name;

            // Add or replace report
            var reportList = study.Reports.Where(report => report.Name != reportName).ToList();

            study.Reports = reportList;
            new MappingController().SaveStudy(study, study.NDAName, study.ProfileName, study.SupplementNumber, study.StudyCode);

            // Delete report files
            DeleteReportFiles(study, reportName);

            return(0);
        }
Exemple #3
0
        private int DoSaveReport(string NDAName, string SupplementNumber, string StudyCode, string ProfileName, Report newReport)
        {
            // Save report settings into the user study profile (FIXME: Improve profile management)
            var study = new MappingController().LoadStudy(NDAName, ProfileName, SupplementNumber, StudyCode, null, true);

            // Add or replace report
            IEnumerable <Report> reports = null;

            if (study.Reports != null)
            {
                reports = study.Reports.Where(report => report.Name != newReport.Name);
            }
            var reportList = (reports ?? new List <Report>()).ToList();

            reportList.Add(newReport);
            reportList    = reportList.OrderBy(r => r.Name).ToList();
            study.Reports = reportList;
            new MappingController().SaveStudy(study, study.NDAName, study.ProfileName, study.SupplementNumber, study.StudyCode);

            return(0);
        }