Class: Renalware::Letters::ApprovedLettersController
- Inherits:
-
BaseController
- Object
- ApplicationController
- ApplicationController
- BaseController
- BaseController
- Renalware::Letters::ApprovedLettersController
- Defined in:
- app/controllers/renalware/letters/approved_letters_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/renalware/letters/approved_letters_controller.rb', line 10 def create letter = @patient.letters.pending_review.find(params[:letter_id]) # See config.broadcast_subscription_map for ApproveLetter event subscribers # We use an event subscription pattern to drive the delivery of letters at this point # rather than hard-wiring in a call to DeliverLetter.call etc. This is because letter # delivery is hospital-specific, and each might want to plumb in different or many classes # to handle different aspects of letter processing - not just delivery but also EPR etc. ApproveLetter .build(letter) .broadcasting_to_configured_subscribers .call(by: current_user) redirect_to patient_clinical_summary_path(@patient), notice: t(".success") end |