renalware-core 2.0.156 → 2.0.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7752535c3cedc34c80615f02356cf882df7875e7c6331102db999f3530941b9f
|
4
|
+
data.tar.gz: 7ce5aa638ff0972fdb81be2f6ff5f988c913fba8d7895864e088727e13db6164
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbde270c7717349a2fce0abc4d3db70a7a07893914a3f2ab8b45f4d77927178c81bfa8983a5d58e1b779de7e0bf1974155507d8f8bb5578276409bc9c8b2d446
|
7
|
+
data.tar.gz: 86e5a36768fbaab56afa31d298f04f64000f9c71e59a1918e725e0d5aaa308db6528131b04ac80c2600dbbc56437cf6d08edb36e1c3266defa5a91c88360b8cc
|
@@ -5,7 +5,7 @@ class AddBMIToClinicVisits < ActiveRecord::Migration[5.2]
|
|
5
5
|
:clinic_visits,
|
6
6
|
:bmi,
|
7
7
|
:decimal,
|
8
|
-
precision:
|
8
|
+
precision: 10,
|
9
9
|
scale: 1,
|
10
10
|
null: true,
|
11
11
|
comment: "Body Mass Index calculated using a before_save when the clinic visit is updated"
|
@@ -13,10 +13,13 @@ class AddBMIToClinicVisits < ActiveRecord::Migration[5.2]
|
|
13
13
|
|
14
14
|
reversible do |direction|
|
15
15
|
direction.up do
|
16
|
+
# Update the bmi for existing clinic visits, but restrict to avoid generating a
|
17
|
+
# non-sense value in case height or weight were entered incorrectly.
|
18
|
+
# NB: height is in metres and weight in kg
|
16
19
|
connection.execute(
|
17
20
|
"update renalware.clinic_visits "\
|
18
21
|
"set bmi = round(((weight / height)::decimal / height::decimal), 1) "\
|
19
|
-
"where height > 0 and weight > 0;"
|
22
|
+
"where height > 0 and height < 3 and weight > 0 and weight < 500;"
|
20
23
|
)
|
21
24
|
end
|
22
25
|
direction.down do
|