예제 #1
0
        public ActionResult PubMlstExport(FromToQueryWithAdjustment queryWithAdjustment)
        {
            if (queryWithAdjustment.From == DateTime.MinValue)
            {
                var lastYear    = DateTime.Now.Year - 1;
                var exportQuery = new FromToQueryWithAdjustment
                {
                    From = new DateTime(lastYear, 1, 1),
                    To   = new DateTime(lastYear, 12, 31)
                };
                return(View(exportQuery));
            }

            //TODO clarify and merge method with Iris-Export should actually be the same
            var sendings          = SendingsMatchingExportQuery(queryWithAdjustment, ExportType.Iris).ToList();
            var duplicateResolver = new DuplicatePatientResolver(new PubMlstColumns());
            Action <DataTable> cleanDuplicates = duplicateResolver.RemovePatientData;

            if (queryWithAdjustment.Unadjusted == YesNo.No)
            {
                sendings.RemoveAll(s => s.SamplingLocation == SamplingLocation.Other);
                cleanDuplicates = duplicateResolver.CleanOrMarkDuplicates;
            }

            return(ExportToExcel(queryWithAdjustment, sendings, new HaemophilusPubMlstExport(), "PubMLST", cleanDuplicates));
        }
예제 #2
0
        protected override ActionResult RkiExportWithPotentialAdjustments(FromToQueryWithAdjustment query)
        {
            var duplicateResolver = new DuplicatePatientResolver(new RkiExportColumns());
            Action <DataTable> cleanDuplicates = duplicateResolver.RemovePatientData;

            if (query.Unadjusted == YesNo.No)
            {
                cleanDuplicates = duplicateResolver.CleanOrMarkDuplicates;
            }

            var sendings = SendingsMatchingExportQuery(query, ExportType.Rki).ToList();

            return(ExportToExcel(query, sendings, CreateRkiExportDefinition(), "RKI", cleanDuplicates));
        }