public async Task <Result <PatientStartTreatmentResponse> > Handle(PatientStartTreatmentCommand request, CancellationToken cancellationToken) { try { PharmacyService pharm = new PharmacyService(_unitOfWork); var result = await pharm.HasPatientTreatmentStarted(request.PatientId); return(Result <PatientStartTreatmentResponse> .Valid(new PatientStartTreatmentResponse { StartTreatment = result })); } catch (Exception ex) { return(Result <PatientStartTreatmentResponse> .Invalid(ex.Message)); } }