Beispiel #1
0
 public HomeController(
     ICPFileService cpFileService,
     IDiagnoseService diagnoseService,
     IDiagService diagService,
     IHospitalPracticeService hospitalPracticeService,
     IPatientService patientService,
     IUsedDrugService usedDrugService,
     ILogger <HomeController> logger,
     MedicDataLocalization medicDataLocalization,
     ICacheable medicCache,
     IMedicLoggerService medicLoggerService,
     IFormattableFactory formattableFactory)
     : base(medicDataLocalization)
 {
     CPFileService           = cpFileService ?? throw new ArgumentNullException(nameof(cpFileService));
     DiagnoseService         = diagnoseService ?? throw new ArgumentNullException(nameof(diagnoseService));
     DiagService             = diagService ?? throw new ArgumentNullException(nameof(diagService));
     HospitalPracticeService = hospitalPracticeService ?? throw new ArgumentNullException(nameof(hospitalPracticeService));
     PatientService          = patientService ?? throw new ArgumentNullException(nameof(patientService));
     UsedDrugService         = usedDrugService ?? throw new ArgumentNullException(nameof(usedDrugService));
     Logger             = logger ?? throw new ArgumentNullException(nameof(logger));
     MedicCache         = medicCache ?? throw new ArgumentNullException(nameof(medicCache));
     MedicLoggerService = medicLoggerService ?? throw new ArgumentNullException(nameof(medicLoggerService));
     FormattableFactory = formattableFactory ?? throw new ArgumentNullException(nameof(formattableFactory));
 }
Beispiel #2
0
 public PatientController(IPatientService patientService,
                          PatientLocalization patientLocalization,
                          MedicDataLocalization medicDataLocalization,
                          ICacheable medicCache,
                          IMedicLoggerService medicLoggerService,
                          IToEHRConverter toEHRConverter,
                          IFormattableFactory formattableFactory)
     : base(patientService, medicCache, medicDataLocalization)
 {
     PatientLocalization = patientLocalization ?? throw new ArgumentNullException(nameof(patientLocalization));
     MedicLoggerService  = medicLoggerService ?? throw new ArgumentNullException(nameof(medicLoggerService));
     ToEHRConverter      = toEHRConverter ?? throw new ArgumentNullException(nameof(toEHRConverter));
     FormattableFactory  = formattableFactory ?? throw new ArgumentNullException(nameof(formattableFactory));
 }
Beispiel #3
0
 public PlannedController(IPlannedService plannedService,
                          IPatientService patientService,
                          IHealthRegionService healthRegionService,
                          MedicDataLocalization medicDataLocalization,
                          ICacheable medicCache,
                          IMedicLoggerService medicLoggerService,
                          IToEHRConverter toEHRConverter,
                          IFormattableFactory formattableFactory)
     : base(patientService, healthRegionService, medicCache, medicDataLocalization)
 {
     PlannedService     = plannedService ?? throw new ArgumentNullException(nameof(plannedService));
     MedicLoggerService = medicLoggerService ?? throw new ArgumentNullException(nameof(medicLoggerService));
     ToEHRConverter     = toEHRConverter ?? throw new ArgumentNullException(nameof(toEHRConverter));
     FormattableFactory = formattableFactory ?? throw new ArgumentNullException(nameof(formattableFactory));
 }
Beispiel #4
0
 public TransferController(
     ITransferService transferService,
     IMedicLoggerService medicLoggerService,
     IToEHRConverter toEHRConverter,
     IFormattableFactory formattableFactory,
     IPatientService patientService,
     IHealthRegionService healthRegionService,
     ICacheable medicCache,
     MedicDataLocalization medicDataLocalization) :
     base(patientService, healthRegionService, medicCache, medicDataLocalization)
 {
     this.TransferService    = transferService ?? throw new ArgumentNullException(nameof(transferService));
     this.MedicLoggerService = medicLoggerService ?? throw new ArgumentNullException(nameof(medicLoggerService));
     this.ToEHRConverter     = toEHRConverter ?? throw new ArgumentNullException(nameof(toEHRConverter));
     this.FormattableFactory = formattableFactory ?? throw new ArgumentNullException(nameof(formattableFactory));
 }
Beispiel #5
0
 public PathProcedureController(IPathProcedureService pathProcedureService,
                                IPatientService patientService,
                                IHealthRegionService healthRegionService,
                                IClinicUsedDrugsService clinicUsedDrugsService,
                                MedicDataLocalization medicDataLocalization,
                                ICacheable medicCache,
                                IMedicLoggerService medicLoggerService,
                                IToEHRConverter toEHRConverter,
                                IFormattableFactory formattableFactory)
     : base(patientService, healthRegionService, medicCache, medicDataLocalization)
 {
     PathProcedureService   = pathProcedureService ?? throw new ArgumentNullException(nameof(pathProcedureService));
     ClinicUsedDrugsService = clinicUsedDrugsService ?? throw new ArgumentNullException(nameof(clinicUsedDrugsService));
     MedicLoggerService     = medicLoggerService ?? throw new ArgumentNullException(nameof(medicLoggerService));
     ToEHRConverter         = toEHRConverter ?? throw new ArgumentNullException(nameof(toEHRConverter));
     FormattableFactory     = formattableFactory ?? throw new ArgumentNullException(nameof(formattableFactory));
 }
Beispiel #6
0
 public OutController(IOutService outService,
                      IPatientService patientService,
                      IUsedDrugService usedDrugService,
                      IHealthRegionService healthRegionService,
                      MedicDataLocalization medicDataLocalization,
                      ICacheable medicCache,
                      IMedicLoggerService medicLoggerService,
                      IToEHRConverter toEHRConverter,
                      IFormattableFactory formattableFactory)
     : base(patientService, healthRegionService, medicCache, medicDataLocalization)
 {
     OutService         = outService ?? throw new ArgumentNullException(nameof(outService));
     UsedDrugService    = usedDrugService ?? throw new ArgumentNullException(nameof(usedDrugService));
     MedicLoggerService = medicLoggerService ?? throw new ArgumentNullException(nameof(medicLoggerService));
     ToEHRConverter     = toEHRConverter ?? throw new ArgumentNullException(nameof(toEHRConverter));
     FormattableFactory = formattableFactory ?? throw new ArgumentNullException(nameof(formattableFactory));
 }
 public ProtocolDrugTherapyController(
     IProtocolDrugTherapyService protocolDrugTherapyService,
     IDrugProtocolService drugProtocolService,
     IPatientService patientService,
     IHealthRegionService healthRegionService,
     MedicDataLocalization medicDataLocalization,
     ICacheable medicCache,
     IMedicLoggerService medicLoggerService,
     IToEHRConverter toEHRConverter,
     IFormattableFactory formattableFactory)
     : base(patientService, healthRegionService, medicCache, medicDataLocalization)
 {
     ProtocolDrugTherapyService = protocolDrugTherapyService ?? throw new ArgumentNullException(nameof(protocolDrugTherapyService));
     DrugProtocolService        = drugProtocolService ?? throw new ArgumentNullException(nameof(drugProtocolService));
     MedicLoggerService         = medicLoggerService ?? throw new ArgumentNullException(nameof(medicLoggerService));
     ToEHRConverter             = toEHRConverter ?? throw new ArgumentNullException(nameof(toEHRConverter));
     FormattableFactory         = formattableFactory ?? throw new ArgumentNullException(nameof(formattableFactory));
 }
Beispiel #8
0
        protected virtual async Task <IActionResult> FormatModel <T>(IEnumerable <T> model, string sheetName, IFormattableFactory formatFactory) where T : class
        {
            if (formatFactory == default)
            {
                throw new ArgumentNullException(nameof(formatFactory));
            }

            if (model == default)
            {
                return(BadRequest());
            }

            MemoryStream memoryStream = new MemoryStream();

            IExcelFormattable excelFormatter = formatFactory.CreateExcelFormatter(memoryStream, MedicDataLocalization);

            await excelFormatter.AddSheet <T>(model, sheetName);

            memoryStream          = (MemoryStream)excelFormatter.Save();
            memoryStream.Position = 0;

            return(new FileStreamResult(memoryStream, excelFormatter.MimeType));
        }