Sha256: ae4f47609a9b0688e7bf9d471d7f5fe9464cf6671be7d434b2a77b4a088568c0
Contents?: true
Size: 1.01 KB
Versions: 62
Compression:
Stored size: 1.01 KB
Contents
# frozen_string_literal: true require_dependency "renalware" module Renalware module API module UKRDC class PatientsController < BaseController respond_to :xml def show respond_to do |format| format.xml { render xml: patient_ukrdc_xml } end end private def patient_ukrdc_xml result = attempt_to_generate_patient_ukrdc_xml if result.failure? result.validation_errors.to_xml else result.xml end end def attempt_to_generate_patient_ukrdc_xml Renalware::UKRDC::XmlRenderer.new(locals: { patient: patient_presenter }).call end def patient_presenter patient = Renalware::Patient.find_by!(secure_id: params[:id]) authorize patient changes_since = params.fetch(:changes_since, "2018-01-01") Renalware::UKRDC::PatientPresenter.new(patient, changes_since: changes_since) end end end end end
Version data entries
62 entries across 62 versions & 1 rubygems