renalware-core 2.0.100 → 2.0.101
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/renalware/hd/stations_controller.rb +1 -1
- data/app/controllers/renalware/hospitals/units_controller.rb +1 -1
- data/app/helpers/renalware/policy_helper.rb +12 -0
- data/app/models/renalware/hospitals/centre.rb +10 -1
- data/app/models/renalware/hospitals/ward.rb +0 -4
- data/app/policies/renalware/hd/station_policy.rb +4 -0
- data/app/policies/renalware/hospitals/ward_policy.rb +11 -0
- data/app/presenters/renalware/hd/station_presenter.rb +4 -0
- data/app/views/renalware/api/ukrdc/patients/_hd_session_observations.xml.builder +43 -0
- data/app/views/renalware/api/ukrdc/patients/_medications.xml.builder +4 -0
- data/app/views/renalware/api/ukrdc/patients/_observations.xml.builder +3 -0
- data/app/views/renalware/api/ukrdc/patients/treatments/_hd.xml.builder +5 -3
- data/app/views/renalware/hd/stations/_station.html.slim +6 -3
- data/app/views/renalware/hd/stations/_table.html.slim +2 -1
- data/app/views/renalware/hd/stations/index.html.slim +4 -3
- data/app/views/renalware/hospitals/units/index.html.slim +18 -12
- data/app/views/renalware/hospitals/wards/index.html.slim +4 -3
- data/app/views/renalware/navigation/_admin.html.slim +0 -1
- data/app/views/renalware/navigation/_renal.html.slim +1 -0
- data/config/locales/loinc_codes.yml +12 -0
- data/config/locales/renalware/navigation/renal.en.yml +1 -0
- data/config/permissions.yml +3 -2
- data/lib/renalware/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be1dd365f062fce54445146b4623f13ae28d5ccc97c0530d78b8c4f9e57a4dc5
|
4
|
+
data.tar.gz: 1b610c630f72fdb4f66585eeb3fbaf6d659ea5ea8f5b3effbbc2d5d12d64f898
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac5d3ea6f737b6bd9b2fef873c0caf1385747eedc1a010c1b7cb136b63422d223ea648e13cb73a6ae05c8afe9504efdb28f851644e131abf6e047c0908dd2ec7
|
7
|
+
data.tar.gz: 535b8985590dc9ee936a504371a0807d4396c8a5e95c3e616217bd3646751de4ccf2cf5a91609a928abbc0395f33b824e0ff71947d761c43f6413626a026ba15
|
@@ -5,7 +5,12 @@ require_dependency "renalware/hospitals"
|
|
5
5
|
module Renalware
|
6
6
|
module Hospitals
|
7
7
|
class Centre < ApplicationRecord
|
8
|
-
has_many
|
8
|
+
has_many(
|
9
|
+
:units,
|
10
|
+
class_name: "Hospitals::Unit",
|
11
|
+
foreign_key: :hospital_centre_id,
|
12
|
+
dependent: :restrict_with_exception
|
13
|
+
)
|
9
14
|
|
10
15
|
scope :ordered, -> { order(:name) }
|
11
16
|
scope :active, -> { where(active: true) }
|
@@ -19,6 +24,10 @@ module Renalware
|
|
19
24
|
units.hd_sites.ordered
|
20
25
|
end
|
21
26
|
|
27
|
+
def self.policy_class
|
28
|
+
BasePolicy
|
29
|
+
end
|
30
|
+
|
22
31
|
def to_s
|
23
32
|
if location.present?
|
24
33
|
"#{name} (#{location})"
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
xml = builder
|
4
|
+
|
5
|
+
observation_times = {
|
6
|
+
pre: session.performed_on + session.start_time.seconds_since_midnight.seconds,
|
7
|
+
post: session.performed_on + session.end_time.seconds_since_midnight.seconds
|
8
|
+
}
|
9
|
+
|
10
|
+
{
|
11
|
+
pre: session.document.observations_before,
|
12
|
+
post: session.document.observations_after
|
13
|
+
}.each do |pre_post, observations|
|
14
|
+
measurements = {
|
15
|
+
"blood_pressure.systolic" => observations.blood_pressure&.systolic,
|
16
|
+
"blood_pressure.diastolic" => observations.blood_pressure&.diastolic,
|
17
|
+
"weight" => observations.weight,
|
18
|
+
"bm_stix" => observations.bm_stix,
|
19
|
+
}
|
20
|
+
|
21
|
+
if observations.temperature_measured == :yes
|
22
|
+
measurements["temperature"] = observations.temperature
|
23
|
+
end
|
24
|
+
|
25
|
+
if observations.respiratory_rate_measured == :yes
|
26
|
+
measurements["respiratory_rate"] = observations.respiratory_rate
|
27
|
+
end
|
28
|
+
|
29
|
+
measurements.each do |i18n_key, value|
|
30
|
+
xml.Observation do
|
31
|
+
xml.ObservationTime observation_times[pre_post].iso8601
|
32
|
+
xml.ObservationCode do
|
33
|
+
xml.CodingStandard "PV"
|
34
|
+
xml.Code I18n.t("loinc.#{i18n_key}.code")
|
35
|
+
xml.Description I18n.t("loinc.#{i18n_key}.description")
|
36
|
+
end
|
37
|
+
|
38
|
+
xml.ObservationValue value
|
39
|
+
xml.ObservationUnits I18n.t("loinc.#{i18n_key}.units")
|
40
|
+
xml.PrePost pre_post.to_s.upcase # eg PRE or POST
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -9,6 +9,10 @@ xml.Medications do
|
|
9
9
|
if prescription.terminated_or_marked_for_termination?
|
10
10
|
xml.ToTime prescription.terminated_on&.to_datetime
|
11
11
|
end
|
12
|
+
xml.EnteringOrganization do
|
13
|
+
xml.CodingStandard "ODS"
|
14
|
+
xml.Code Renalware.config.ukrdc_site_code
|
15
|
+
end
|
12
16
|
xml.Route do
|
13
17
|
xml.CodingStandard "RR22"
|
14
18
|
xml.Code prescription.medication_route&.rr_code
|
@@ -8,10 +8,12 @@ xml.Treatment do
|
|
8
8
|
xml.FromTime treatment.started_on&.iso8601
|
9
9
|
xml.ToTime(treatment.ended_on&.iso8601) if treatment.ended_on.present?
|
10
10
|
|
11
|
-
|
12
|
-
xml.
|
13
|
-
|
11
|
+
xml.HealthCareFacility do
|
12
|
+
xml.CodingStandard "ODS"
|
13
|
+
if treatment.hospital_unit.present?
|
14
14
|
xml.Code treatment.hospital_unit.renal_registry_code
|
15
|
+
else
|
16
|
+
xml.Code Renalware.config.ukrdc_site_code
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
@@ -1,6 +1,9 @@
|
|
1
1
|
tr.sortable(id="hd-station-#{station.id}")
|
2
|
-
td
|
2
|
+
td
|
3
|
+
- if policy(station).update?
|
4
|
+
= link_to "Edit", edit_hd_unit_station_path(station.hospital_unit_id, station)
|
3
5
|
td= station.name
|
4
6
|
td= station.location&.name
|
5
|
-
|
6
|
-
|
7
|
+
- if policy(station).sort?
|
8
|
+
td.handle
|
9
|
+
i.fas.fa-bars
|
@@ -4,6 +4,7 @@ table.hd-stations
|
|
4
4
|
th.col-width-tiny
|
5
5
|
th.col-width-large Name
|
6
6
|
th Location
|
7
|
-
|
7
|
+
- if policy(Renalware::HD::Station.new).sort?
|
8
|
+
th.col-width-tiny Reorder
|
8
9
|
tbody.sortables data-rel=sort_hd_unit_stations_path(unit_id: unit_id)
|
9
10
|
= render stations
|
@@ -4,9 +4,10 @@
|
|
4
4
|
breadcrumb_for(unit.unit_code, edit_hospitals_unit_path(unit))]
|
5
5
|
|
6
6
|
= content_for(:actions) do
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
- if policy(Renalware::HD::Station.new).create?
|
8
|
+
= link_to t("new_record.link_title"),
|
9
|
+
new_hd_unit_station_path(unit_id: unit.id),
|
10
|
+
class: "button"
|
10
11
|
|
11
12
|
= within_admin_layout(title: "HD Stations", breadcrumbs: breadcrumbs) do
|
12
13
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
= content_for(:actions) do
|
2
|
-
|
2
|
+
- if pundit_policy_for(Renalware::Hospitals::Centre).create?
|
3
|
+
= link_to t("new_record.link_title"), new_hospitals_unit_path, class: "button"
|
3
4
|
|
4
5
|
= within_admin_layout(title: "Hospital Units") do
|
5
6
|
|
@@ -19,12 +20,14 @@
|
|
19
20
|
- hospital_units.each do |unit|
|
20
21
|
tr
|
21
22
|
td
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
- if policy(unit).edit?
|
24
|
+
= link_to "Edit", edit_hospitals_unit_path(unit.id)
|
25
|
+
= pipe_separator
|
26
|
+
- if policy(unit).destroy?
|
27
|
+
= link_to "Delete",
|
28
|
+
hospitals_unit_path(unit.id),
|
29
|
+
method: :delete,
|
30
|
+
data: { confirm: I18n.t("prompts.confirm_delete") }
|
28
31
|
td= unit.unit_code
|
29
32
|
td= unit.name
|
30
33
|
td= unit.hospital_centre
|
@@ -33,8 +36,11 @@
|
|
33
36
|
td= yes_no unit.is_hd_site
|
34
37
|
td= Renalware::HD::Station.where(hospital_unit_id: unit.id).count
|
35
38
|
td.actions
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
- if pundit_policy_for(Renalware::HD::Station).index?
|
40
|
+
= link_to("HD Stations", hd_unit_stations_path(unit))
|
41
|
+
= pipe_separator
|
42
|
+
- if pundit_policy_for(Renalware::HD::Diary).index?
|
43
|
+
= link_to("HD Diaries", hd_unit_diaries_path(unit))
|
44
|
+
- if pundit_policy_for(Renalware::Hospitals::Ward).index?
|
45
|
+
= pipe_separator
|
46
|
+
= link_to("Wards", hospitals_unit_wards_path(unit))
|
@@ -1,7 +1,8 @@
|
|
1
1
|
= content_for(:actions) do
|
2
|
-
|
3
|
-
|
4
|
-
|
2
|
+
- if policy(Renalware::Hospitals::Ward.new).create?
|
3
|
+
= link_to "Add",
|
4
|
+
new_hospitals_unit_ward_path(unit),
|
5
|
+
class: "button"
|
5
6
|
|
6
7
|
= within_admin_layout(title: "Wards", breadcrumbs: \
|
7
8
|
breadcrumb_for(unit.name, hospitals_units_path)) do
|
@@ -2,7 +2,6 @@ li.has-dropdown
|
|
2
2
|
= link_to "Admin", "#"
|
3
3
|
ul.dropdown
|
4
4
|
li= link_to "Users", admin_users_path
|
5
|
-
li= link_to "Hospital Units", hospitals_units_path
|
6
5
|
li= link_to "Request Form Print History", pathology_requests_requests_path
|
7
6
|
li= link_to "Pathology Requesting Configuration", pathology_requests_rules_path
|
8
7
|
li= link_to "HD Transmission Logs", hd_transmission_logs_path
|
@@ -12,4 +12,5 @@ li.has-dropdown
|
|
12
12
|
li= link_to t(".audits"), reporting_audits_path
|
13
13
|
li= link_to t(".aki_alerts"), renal_aki_alerts_path
|
14
14
|
li= link_to t(".studies"), research_studies_path
|
15
|
+
li= link_to t(".hospital_units"), hospitals_units_path
|
15
16
|
li= link_to t(".renal_registry_checks"), patients_renal_registry_preflight_checks_path
|
@@ -20,3 +20,15 @@ en:
|
|
20
20
|
code: height
|
21
21
|
description: Height Measured
|
22
22
|
units: "cm"
|
23
|
+
temperature:
|
24
|
+
code: temperature
|
25
|
+
description: Temperature
|
26
|
+
units: "C"
|
27
|
+
bm_stix:
|
28
|
+
code: bm_stix
|
29
|
+
description: bm_stix
|
30
|
+
units: "?"
|
31
|
+
respiratory_rate:
|
32
|
+
code: respiratory_rate
|
33
|
+
description: respiratory_rate
|
34
|
+
units: "?"
|
data/config/permissions.yml
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
super_admin:
|
2
2
|
- Renalware::Role
|
3
3
|
- Renalware::Hospitals::Ward
|
4
|
+
- Renalware::Hospitals::Centre
|
5
|
+
- Renalware::Hospitals::Unit
|
4
6
|
- Renalware::HD::Dialysate
|
5
7
|
- Renalware::HD::Dialyser
|
6
8
|
- Renalware::HD::CannulationType
|
@@ -16,6 +18,5 @@ admin:
|
|
16
18
|
- Renalware::Modality::Description
|
17
19
|
- Renalware::OrganismCode
|
18
20
|
- Renalware::PRDDescription
|
19
|
-
- Renalware::Hospitals::Unit
|
20
|
-
- Renalware::HD::Station
|
21
21
|
- Renalware::HD::TransmissionLog
|
22
|
+
- Renalware::HD::Station
|
data/lib/renalware/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: renalware-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.101
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Airslie
|
@@ -1324,6 +1324,7 @@ files:
|
|
1324
1324
|
- app/helpers/renalware/pd_regime_bags_helper.rb
|
1325
1325
|
- app/helpers/renalware/pd_regimes_helper.rb
|
1326
1326
|
- app/helpers/renalware/pdf_helper.rb
|
1327
|
+
- app/helpers/renalware/policy_helper.rb
|
1327
1328
|
- app/helpers/renalware/prescriptions_helper.rb
|
1328
1329
|
- app/helpers/renalware/primary_care_physicians_helper.rb
|
1329
1330
|
- app/helpers/renalware/problems_helper.rb
|
@@ -1895,6 +1896,7 @@ files:
|
|
1895
1896
|
- app/policies/renalware/hd/open_session_policy.rb
|
1896
1897
|
- app/policies/renalware/hd/session_policy.rb
|
1897
1898
|
- app/policies/renalware/hd/station_policy.rb
|
1899
|
+
- app/policies/renalware/hospitals/ward_policy.rb
|
1898
1900
|
- app/policies/renalware/letters/approved_letter_policy.rb
|
1899
1901
|
- app/policies/renalware/letters/completed_letter_policy.rb
|
1900
1902
|
- app/policies/renalware/letters/draft_letter_policy.rb
|
@@ -2148,6 +2150,7 @@ files:
|
|
2148
2150
|
- app/views/renalware/api/ukrdc/patients/_documents.xml.builder
|
2149
2151
|
- app/views/renalware/api/ukrdc/patients/_encounters.xml.builder
|
2150
2152
|
- app/views/renalware/api/ukrdc/patients/_family_histories.xml.builder
|
2153
|
+
- app/views/renalware/api/ukrdc/patients/_hd_session_observations.xml.builder
|
2151
2154
|
- app/views/renalware/api/ukrdc/patients/_lab_orders.xml.builder
|
2152
2155
|
- app/views/renalware/api/ukrdc/patients/_medications.xml.builder
|
2153
2156
|
- app/views/renalware/api/ukrdc/patients/_name.xml.builder
|