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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }