Sha256: be3706903bdecc7b22b87cd135d00c1ddfaf674b0dcc8190be9b0716978fc508

Contents?: true

Size: 1.11 KB

Versions: 22

Compression:

Stored size: 1.11 KB

Contents

def modify_query(url, options={})
  uri = URI(url)
  query_hash = Rack::Utils.parse_query(uri.query)
  query_hash.merge!(options)
  uri.query = Rack::Utils.build_query(query_hash)
  uri.to_s
end

json.links do
  json.prev patients.prev_page && modify_query(request.url, "page" => patients.prev_page)
  json.next patients.next_page && modify_query(request.url, "page" => patients.next_page)
  json.total_pages patients.total_pages
  json.next_page patients.next_page
  json.current_page patients.current_page
  json.prev_page patients.prev_page
end

json.data patients do |patient|
  json.id patient.id
  json.secure_id patient.secure_id
  json.local_patient_id patient.local_patient_id
  json.local_patient_id_2 patient.local_patient_id_2
  json.local_patient_id_3 patient.local_patient_id_3
  json.local_patient_id_4 patient.local_patient_id_4
  json.nhs_number patient.nhs_number
  json.family_name patient.family_name
  json.given_name patient.given_name
  json.title patient.title
  json.born_on patient.born_on
  json.sex patient.sex&.code
  json.send_to_renalreg patient.send_to_renalreg
  json.send_to_rpv patient.send_to_rpv
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
renalware-core-2.0.37 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.36 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.35 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.34 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.33 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.32 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.31 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.30 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.28 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.27 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.26 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.25 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.24 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.23 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.22 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.21 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.20 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.18 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.17 app/views/renalware/api/v1/patients/patients/index.json.jbuilder
renalware-core-2.0.16 app/views/renalware/api/v1/patients/patients/index.json.jbuilder