Sha256: d3a73a6a6d777501c25f71063e75b53b71e6103a7a8a46a64f2e2335fe17841d

Contents?: true

Size: 1.37 KB

Versions: 9

Compression:

Stored size: 1.37 KB

Contents

module Renalware
  module PrescriptionsHelper
    def patient_prescriptions_path(patient, treatable = nil, params = {})
      treatable ||= patient
      super(patient, params.merge(treatable_type: treatable.class.to_s, treatable_id: treatable.id))
    end

    def new_patient_prescription_path(patient, treatable = nil)
      treatable ||= patient
      super(patient, treatable_type: treatable.class.to_s, treatable_id: treatable.id)
    end

    def patient_medications_prescription_termination_path(patient, prescription, treatable = nil)
      treatable ||= patient
      super(patient, prescription, treatable_type: treatable.class.to_s, treatable_id: treatable.id)
    end

    def new_patient_medications_prescription_termination_path(patient,
                                                              prescription,
                                                              treatable = nil)
      treatable ||= patient
      super(patient, prescription, treatable_type: treatable.class.to_s, treatable_id: treatable.id)
    end

    def highlight_validation_fail(med_object, med_attribute)
      return unless med_object.errors.include?(med_attribute)

      "field_with_errors"
    end

    def validation_fail(prescription)
      prescription.errors.any? ? "show-form" : "content"
    end

    def default_provider(provider)
      provider == "gp" ? "checked" : nil
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
renalware-core-2.0.0.pre.beta12 app/helpers/renalware/prescriptions_helper.rb
renalware-core-2.0.0.pre.beta11 app/helpers/renalware/prescriptions_helper.rb
renalware-core-2.0.0.pre.beta10 app/helpers/renalware/prescriptions_helper.rb
renalware-core-2.0.0.pre.beta9 app/helpers/renalware/prescriptions_helper.rb
renalware-core-2.0.0.pre.beta8 app/helpers/renalware/prescriptions_helper.rb
renalware-core-2.0.0.pre.beta7 app/helpers/renalware/prescriptions_helper.rb
renalware-core-2.0.0.pre.beta6 app/helpers/renalware/prescriptions_helper.rb
renalware-core-2.0.0.pre.beta5 app/helpers/renalware/prescriptions_helper.rb
renalware-core-2.0.0.pre.beta4 app/helpers/renalware/prescriptions_helper.rb