renalware-core 2.0.0.pre.beta8 → 2.0.0.pre.beta9

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.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +19 -1
  3. data/app/assets/stylesheets/renalware/lib/_select2-foundation5-overrides.scss +2 -2
  4. data/app/controllers/renalware/directory/people_controller.rb +1 -1
  5. data/app/controllers/renalware/letters/contacts_controller.rb +1 -1
  6. data/app/controllers/renalware/letters/letters_controller.rb +1 -1
  7. data/app/controllers/renalware/patients/patients_controller.rb +3 -5
  8. data/app/controllers/renalware/patients/primary_care_physicians_controller.rb +1 -1
  9. data/app/controllers/renalware/renal/aki_alerts_controller.rb +44 -0
  10. data/app/controllers/renalware/renal/profiles_controller.rb +1 -1
  11. data/app/controllers/renalware/reporting/audits_controller.rb +9 -3
  12. data/app/documents/renalware/patient_document.rb +0 -13
  13. data/app/jobs/hl7_message_example.yml +1 -1
  14. data/app/jobs/renalware/reporting/refresh_audit_data_job.rb +7 -3
  15. data/app/models/renalware/clinical/create_allergy.rb +4 -2
  16. data/app/models/renalware/clinics/create_clinic_visit.rb +6 -2
  17. data/app/models/renalware/hd/session.rb +12 -0
  18. data/app/models/renalware/hospitals/unit.rb +4 -0
  19. data/app/models/renalware/hospitals/ward.rb +22 -0
  20. data/app/models/renalware/modalities/change_patient_modality.rb +4 -2
  21. data/app/models/renalware/patient.rb +1 -0
  22. data/app/models/renalware/patients/language.rb +1 -0
  23. data/app/models/renalware/pd/create_regime.rb +4 -2
  24. data/app/models/renalware/pd/revise_regime.rb +5 -3
  25. data/app/models/renalware/renal/aki_alert.rb +15 -0
  26. data/app/models/renalware/renal/aki_alert_action.rb +10 -0
  27. data/app/models/renalware/reporting/audit.rb +2 -3
  28. data/app/models/renalware/reporting/generate_audit_json.rb +21 -5
  29. data/app/models/renalware/system/country.rb +21 -0
  30. data/app/models/renalware/transplants/create_donor_stage.rb +4 -2
  31. data/app/policies/renalware/base_policy.rb +4 -0
  32. data/app/policies/renalware/renal/aki_alert_policy.rb +9 -0
  33. data/app/presenters/renalware/hd/patient_presenter.rb +5 -0
  34. data/app/presenters/renalware/reporting/audit_presenter.rb +1 -0
  35. data/app/presenters/renalware/transplants/patient_presenter.rb +2 -1
  36. data/app/presenters/renalware/ukrdc/patient_presenter.rb +27 -0
  37. data/app/values/renalware/address.rb +2 -13
  38. data/app/views/renalware/addresses/_form.html.slim +4 -2
  39. data/app/views/renalware/api/ukrdc/patients/_address.xml.builder +2 -2
  40. data/app/views/renalware/api/ukrdc/patients/_diagnoses.xml.builder +5 -2
  41. data/app/views/renalware/api/ukrdc/patients/_encounters.xml.builder +8 -1
  42. data/app/views/renalware/api/ukrdc/patients/_medications.xml.builder +30 -0
  43. data/app/views/renalware/api/ukrdc/patients/_patient.xml.builder +36 -4
  44. data/app/views/renalware/api/ukrdc/patients/_sending_facility.xml.builder +1 -0
  45. data/app/views/renalware/api/ukrdc/patients/diagnoses/_cause_of_death.xml.builder +10 -0
  46. data/app/views/renalware/api/ukrdc/patients/encounters/_hd_session.xml.builder +40 -0
  47. data/app/views/renalware/api/ukrdc/patients/show.xml.builder +1 -0
  48. data/app/views/renalware/directory/people/_address_form.html.slim +1 -1
  49. data/app/views/renalware/hd/sessions/_form.html.slim +43 -33
  50. data/app/views/renalware/letters/contacts/_person_form.html.slim +1 -1
  51. data/app/views/renalware/navigation/_renal.html.slim +1 -0
  52. data/app/views/renalware/patients/patients/_form.html.slim +5 -2
  53. data/app/views/renalware/patients/patients/show.html.slim +0 -5
  54. data/app/views/renalware/patients/patients/show/_patient_demographics.html.slim +3 -3
  55. data/app/views/renalware/patients/side_menu/_actions.html.slim +3 -0
  56. data/app/views/renalware/renal/aki_alerts/_filters.html.slim +0 -0
  57. data/app/views/renalware/renal/aki_alerts/edit.html.slim +17 -0
  58. data/app/views/renalware/renal/aki_alerts/index.html.slim +28 -0
  59. data/app/views/renalware/reporting/audits/edit.html.slim +1 -1
  60. data/app/views/renalware/reporting/audits/index.html.slim +11 -7
  61. data/app/views/renalware/reporting/audits/show.html.slim +2 -17
  62. data/app/views/renalware/shared/documents/_blood_pressure_input.html.slim +6 -7
  63. data/config/initializers/inflections.rb +3 -2
  64. data/config/locales/renalware/navigation/renal.en.yml +1 -0
  65. data/config/locales/renalware/renal/aki_alerts.en.yml +5 -0
  66. data/config/locales/renalware/renal/{profile.yml → profile.en.yml} +0 -0
  67. data/config/locales/renalware/reporting/audit.en.yml +1 -1
  68. data/config/routes.rb +1 -0
  69. data/db/migrate/20150312113937_create_drug_types_drugs.rb +2 -2
  70. data/db/migrate/20170925161033_add_code_to_patient_langauges.rb +6 -0
  71. data/db/migrate/20170925182738_add_rr_code_to_medication_routes.rb +5 -0
  72. data/db/migrate/20170926081426_create_countries.rb +14 -0
  73. data/db/migrate/20170926132845_add_country_of_birth_to_patients.rb +6 -0
  74. data/db/migrate/20171002175804_add_rr_columns_to_transplant_registration_status_descriptions.rb +12 -0
  75. data/db/migrate/20171003093347_create_hospital_wards.rb +17 -0
  76. data/db/migrate/20171003111228_create_aki_alert_actions.rb +10 -0
  77. data/db/migrate/20171003122425_create_renal_aki_alerts.rb +22 -0
  78. data/db/migrate/20171005081224_create_reporting_bone_audit.rb +5 -0
  79. data/db/migrate/20171005091202_reporting_audit_changes.rb +7 -0
  80. data/db/migrate/20171005130109_create_medication_current_prescriptions.rb +5 -0
  81. data/db/migrate/20171005144505_create_reporting_anaemia_audit.rb +5 -0
  82. data/db/migrate/20171009104106_add_legacy_patient_id_to_patients.rb +6 -0
  83. data/db/seeds/default/events/{event_types_required.csv → event_types.csv} +0 -0
  84. data/db/seeds/default/events/{event_types_required.rb → event_types.rb} +2 -2
  85. data/db/seeds/default/events/seeds.rb +1 -2
  86. data/db/seeds/default/medications/medication_routes.rb +23 -13
  87. data/db/seeds/default/patients/patients_languages.csv +192 -102
  88. data/db/seeds/default/patients/patients_languages.rb +1 -1
  89. data/db/seeds/default/patients/patients_religions.csv +2 -0
  90. data/db/seeds/default/reporting/audits.rb +4 -3
  91. data/db/seeds/default/reporting/audits.yml +47 -4
  92. data/db/seeds/default/system/countries.csv +250 -0
  93. data/db/seeds/default/system/countries.rb +12 -0
  94. data/db/seeds/default/system/seeds.rb +1 -0
  95. data/db/seeds/default/transplants/transplant_registration_statuses.rb +30 -19
  96. data/db/views/medication_current_prescriptions_v01.sql +28 -0
  97. data/db/views/reporting_anaemia_audit_v01.sql +41 -0
  98. data/db/views/reporting_bone_audit_v01.sql +32 -0
  99. data/lib/renalware/version.rb +1 -1
  100. data/spec/factories/deaths/cause.rb +1 -1
  101. data/spec/factories/drugs/drug.rb +6 -0
  102. data/spec/factories/drugs/drug_types.rb +5 -0
  103. data/spec/factories/hospitals/wards.rb +9 -0
  104. data/spec/factories/modalities/modality_descriptions.rb +10 -8
  105. data/spec/factories/patients/ethnicities.rb +3 -0
  106. data/spec/factories/patients/languages.rb +12 -1
  107. data/spec/factories/renal/aki_alert_actions.rb +5 -0
  108. data/spec/factories/renal/aki_alerts.rb +9 -0
  109. data/spec/factories/reporting/audits.rb +1 -1
  110. data/spec/factories/system/addresses.rb +1 -1
  111. data/spec/factories/system/countries.rb +15 -0
  112. metadata +42 -13
  113. data/app/values/renalware/country.rb +0 -19
  114. data/config/countries.csv +0 -250
  115. data/db/migrate/20170706120643_create_reporting_data_sources.rb +0 -5
  116. data/db/seeds/default/events/event_types_blt.csv +0 -109
  117. data/db/seeds/default/events/event_types_local.rb +0 -10
  118. data/db/views/reporting_data_sources_v01.sql +0 -17
@@ -1,19 +0,0 @@
1
- # rubocop:disable Style/StructInheritance
2
- module Renalware
3
- class Country < Struct.new(:name, :code)
4
-
5
- def self.all
6
- @all ||= data.map{ |row| Country.new(row[0], row[1]) }
7
- end
8
-
9
- def self.data
10
- CSV.read(Engine.root.join("config", "countries.csv"), headers: true)
11
- end
12
-
13
- def self.code_for(country_name)
14
- country = all.find{ |cntry| cntry.name == country_name }
15
- return unless country
16
- country.code
17
- end
18
- end
19
- end
data/config/countries.csv DELETED
@@ -1,250 +0,0 @@
1
- Name,Code
2
- Afghanistan,AF
3
- Åland Islands,AX
4
- Albania,AL
5
- Algeria,DZ
6
- American Samoa,AS
7
- Andorra,AD
8
- Angola,AO
9
- Anguilla,AI
10
- Antarctica,AQ
11
- Antigua and Barbuda,AG
12
- Argentina,AR
13
- Armenia,AM
14
- Aruba,AW
15
- Australia,AU
16
- Austria,AT
17
- Azerbaijan,AZ
18
- Bahamas,BS
19
- Bahrain,BH
20
- Bangladesh,BD
21
- Barbados,BB
22
- Belarus,BY
23
- Belgium,BE
24
- Belize,BZ
25
- Benin,BJ
26
- Bermuda,BM
27
- Bhutan,BT
28
- "Bolivia, Plurinational State of",BO
29
- "Bonaire, Sint Eustatius and Saba",BQ
30
- Bosnia and Herzegovina,BA
31
- Botswana,BW
32
- Bouvet Island,BV
33
- Brazil,BR
34
- British Indian Ocean Territory,IO
35
- Brunei Darussalam,BN
36
- Bulgaria,BG
37
- Burkina Faso,BF
38
- Burundi,BI
39
- Cambodia,KH
40
- Cameroon,CM
41
- Canada,CA
42
- Cape Verde,CV
43
- Cayman Islands,KY
44
- Central African Republic,CF
45
- Chad,TD
46
- Chile,CL
47
- China,CN
48
- Christmas Island,CX
49
- Cocos (Keeling) Islands,CC
50
- Colombia,CO
51
- Comoros,KM
52
- Congo,CG
53
- "Congo, the Democratic Republic of the",CD
54
- Cook Islands,CK
55
- Costa Rica,CR
56
- Côte d'Ivoire,CI
57
- Croatia,HR
58
- Cuba,CU
59
- Curaçao,CW
60
- Cyprus,CY
61
- Czech Republic,CZ
62
- Denmark,DK
63
- Djibouti,DJ
64
- Dominica,DM
65
- Dominican Republic,DO
66
- Ecuador,EC
67
- Egypt,EG
68
- El Salvador,SV
69
- Equatorial Guinea,GQ
70
- Eritrea,ER
71
- Estonia,EE
72
- Ethiopia,ET
73
- Falkland Islands (Malvinas),FK
74
- Faroe Islands,FO
75
- Fiji,FJ
76
- Finland,FI
77
- France,FR
78
- French Guiana,GF
79
- French Polynesia,PF
80
- French Southern Territories,TF
81
- Gabon,GA
82
- Gambia,GM
83
- Georgia,GE
84
- Germany,DE
85
- Ghana,GH
86
- Gibraltar,GI
87
- Greece,GR
88
- Greenland,GL
89
- Grenada,GD
90
- Guadeloupe,GP
91
- Guam,GU
92
- Guatemala,GT
93
- Guernsey,GG
94
- Guinea,GN
95
- Guinea-Bissau,GW
96
- Guyana,GY
97
- Haiti,HT
98
- Heard Island and McDonald Islands,HM
99
- Holy See (Vatican City State),VA
100
- Honduras,HN
101
- Hong Kong,HK
102
- Hungary,HU
103
- Iceland,IS
104
- India,IN
105
- Indonesia,ID
106
- "Iran, Islamic Republic of",IR
107
- Iraq,IQ
108
- Ireland,IE
109
- Isle of Man,IM
110
- Israel,IL
111
- Italy,IT
112
- Jamaica,JM
113
- Japan,JP
114
- Jersey,JE
115
- Jordan,JO
116
- Kazakhstan,KZ
117
- Kenya,KE
118
- Kiribati,KI
119
- "Korea, Democratic People's Republic of",KP
120
- "Korea, Republic of",KR
121
- Kuwait,KW
122
- Kyrgyzstan,KG
123
- Lao People's Democratic Republic,LA
124
- Latvia,LV
125
- Lebanon,LB
126
- Lesotho,LS
127
- Liberia,LR
128
- Libya,LY
129
- Liechtenstein,LI
130
- Lithuania,LT
131
- Luxembourg,LU
132
- Macao,MO
133
- "Macedonia, the Former Yugoslav Republic of",MK
134
- Madagascar,MG
135
- Malawi,MW
136
- Malaysia,MY
137
- Maldives,MV
138
- Mali,ML
139
- Malta,MT
140
- Marshall Islands,MH
141
- Martinique,MQ
142
- Mauritania,MR
143
- Mauritius,MU
144
- Mayotte,YT
145
- Mexico,MX
146
- "Micronesia, Federated States of",FM
147
- "Moldova, Republic of",MD
148
- Monaco,MC
149
- Mongolia,MN
150
- Montenegro,ME
151
- Montserrat,MS
152
- Morocco,MA
153
- Mozambique,MZ
154
- Myanmar,MM
155
- Namibia,NA
156
- Nauru,NR
157
- Nepal,NP
158
- Netherlands,NL
159
- New Caledonia,NC
160
- New Zealand,NZ
161
- Nicaragua,NI
162
- Niger,NE
163
- Nigeria,NG
164
- Niue,NU
165
- Norfolk Island,NF
166
- Northern Mariana Islands,MP
167
- Norway,NO
168
- Oman,OM
169
- Pakistan,PK
170
- Palau,PW
171
- "Palestine, State of",PS
172
- Panama,PA
173
- Papua New Guinea,PG
174
- Paraguay,PY
175
- Peru,PE
176
- Philippines,PH
177
- Pitcairn,PN
178
- Poland,PL
179
- Portugal,PT
180
- Puerto Rico,PR
181
- Qatar,QA
182
- Réunion,RE
183
- Romania,RO
184
- Russian Federation,RU
185
- Rwanda,RW
186
- Saint Barthélemy,BL
187
- "Saint Helena, Ascension and Tristan da Cunha",SH
188
- Saint Kitts and Nevis,KN
189
- Saint Lucia,LC
190
- Saint Martin (French part),MF
191
- Saint Pierre and Miquelon,PM
192
- Saint Vincent and the Grenadines,VC
193
- Samoa,WS
194
- San Marino,SM
195
- Sao Tome and Principe,ST
196
- Saudi Arabia,SA
197
- Senegal,SN
198
- Serbia,RS
199
- Seychelles,SC
200
- Sierra Leone,SL
201
- Singapore,SG
202
- Sint Maarten (Dutch part),SX
203
- Slovakia,SK
204
- Slovenia,SI
205
- Solomon Islands,SB
206
- Somalia,SO
207
- South Africa,ZA
208
- South Georgia and the South Sandwich Islands,GS
209
- South Sudan,SS
210
- Spain,ES
211
- Sri Lanka,LK
212
- Sudan,SD
213
- Suriname,SR
214
- Svalbard and Jan Mayen,SJ
215
- Swaziland,SZ
216
- Sweden,SE
217
- Switzerland,CH
218
- Syrian Arab Republic,SY
219
- "Taiwan, Province of China",TW
220
- Tajikistan,TJ
221
- "Tanzania, United Republic of",TZ
222
- Thailand,TH
223
- Timor-Leste,TL
224
- Togo,TG
225
- Tokelau,TK
226
- Tonga,TO
227
- Trinidad and Tobago,TT
228
- Tunisia,TN
229
- Turkey,TR
230
- Turkmenistan,TM
231
- Turks and Caicos Islands,TC
232
- Tuvalu,TV
233
- Uganda,UG
234
- Ukraine,UA
235
- United Arab Emirates,AE
236
- United Kingdom,GB
237
- United States,US
238
- United States Minor Outlying Islands,UM
239
- Uruguay,UY
240
- Uzbekistan,UZ
241
- Vanuatu,VU
242
- "Venezuela, Bolivarian Republic of",VE
243
- Viet Nam,VN
244
- "Virgin Islands, British",VG
245
- "Virgin Islands, U.S.",VI
246
- Wallis and Futuna,WF
247
- Western Sahara,EH
248
- Yemen,YE
249
- Zambia,ZM
250
- Zimbabwe,ZW
@@ -1,5 +0,0 @@
1
- class CreateReportingDataSources < ActiveRecord::Migration[5.0]
2
- def change
3
- create_view :reporting_data_sources
4
- end
5
- end
@@ -1,109 +0,0 @@
1
- "name"
2
- "A&E assessment--Anaesthetic Review"
3
- "Access--Anaesthetic Review"
4
- "Access--Assessment"
5
- "Access--Clinic"
6
- "Access--Clinic Review"
7
- "Access--Comment / Others"
8
- "Access--MDT"
9
- "Access--Surgery"
10
- "Anaesthetic assessment--Anaesthetic Review"
11
- "Biopsy--Comment / Others"
12
- "Biopsy--MDT"
13
- "Clinic--AKI"
14
- "Clinic--Clinic"
15
- "Clinic--General Nephrology"
16
- "Clinic--HD"
17
- "Clinic--HomeHD"
18
- "Clinic--Joint clinic"
19
- "Clinic--Live Donor Assessment"
20
- "Clinic--Live Donor FU"
21
- "Clinic--Low Clearance"
22
- "Clinic--Misc / Others"
23
- "Clinic--PD"
24
- "Clinic--PKD"
25
- "Clinic--Post Transplant"
26
- "Clinic--Pre Transplant Assessment"
27
- "Clinic--Supportive Care"
28
- "Clinical Trial--Comment / Others"
29
- "Clinical Trial--Phone Call"
30
- "Clinical Trial--Review"
31
- "Clinical Trial--Study Visit"
32
- "Correspondence--Correspondence"
33
- "Diabetes--Clinic"
34
- "Diabetes--Comment / Others"
35
- "Diabetes--MDT"
36
- "Diabetes--Post Transplant"
37
- "Dietitian clinic"
38
- "Dietitian Clinic Review"
39
- "Dietitian Comment / Others"
40
- "Dietitian Phone Call"
41
- "Email"
42
- "E-mail--correspondence"
43
- "EPO Comment / Others"
44
- "EPO Phone Call"
45
- "EPO Review"
46
- "Haemodialysis Clinic"
47
- "Haemodialysis Clinic Review"
48
- "Haemodialysis Comment / Others"
49
- "Haemodialysis MDT"
50
- "Haemodialysis Ward round"
51
- "Infusion / Injection--Antibiotics"
52
- "Infusion / Injection--Belatacept"
53
- "Infusion / Injection--Blood transfusion"
54
- "Infusion / Injection--Comment / Others"
55
- "Infusion / Injection--Cyclophosphamide"
56
- "Infusion / Injection--Eclizimab"
57
- "Infusion / Injection--Hep B vaccination"
58
- "Infusion / Injection--iv Iron"
59
- "Infusion / Injection--MethylPrednisolone"
60
- "Infusion / Injection--Rituximab"
61
- "Infusion / Injection--tPA infusion"
62
- "IN-PATIENT--In-patient"
63
- "LCC Assessment"
64
- "LCC Clinic"
65
- "LCC Clinic Review"
66
- "LCC Comment / Others"
67
- "LCC Community Visit"
68
- "LCC Emergency Visit"
69
- "LCC MDT"
70
- "LCC Phone Call"
71
- "Live Donor--Clinic"
72
- "Live Donor--Clinic Review"
73
- "Live Donor--Comment / Others"
74
- "Live Donor--HTA assessment"
75
- "Live Donor--MDT"
76
- "Live Donor--Phone Call"
77
- "MDT Comment / Others"
78
- "MDT Histology"
79
- "MDT Radiology"
80
- "PD / Home Dialysis--APD_Session"
81
- "PD / Home Dialysis--Clinic"
82
- "PD / Home Dialysis--Clinic Review"
83
- "PD / Home Dialysis--Comment / Others"
84
- "PD / Home Dialysis--Community Visit"
85
- "PD / Home Dialysis--Emergency Visit"
86
- "PD / Home Dialysis--In-patient"
87
- "PD / Home Dialysis--MDT"
88
- "PD / Home Dialysis--Nurse Clinic"
89
- "PD / Home Dialysis--Peritonitis_D1"
90
- "PD / Home Dialysis--Phone Call"
91
- "PD / Home Dialysis--Training"
92
- "Pre-transplant assessment--Clinic"
93
- "Pre-transplant assessment--Clinic Review"
94
- "Pre-transplant assessment--Comment / Others"
95
- "Pre-transplant assessment--High risk transplant MDT"
96
- "Pre-transplant assessment--MDT"
97
- "Pre-transplant assessment--Phone Call"
98
- "Pre-admission Clinic"
99
- "RAU Assessment"
100
- "RAU Clinic"
101
- "RAU Comment / Others"
102
- "RAU Review"
103
- "Supportive Care--Clinic"
104
- "Supportive Care--Comment / Others"
105
- "Supportive Care--Community Visit"
106
- "Supportive Care--Correspondence"
107
- "Supportive Care--MDT"
108
- "Supportive Care--Phone Call"
109
- "Supportive Care--Supportive Care"
@@ -1,10 +0,0 @@
1
- module Renalware
2
- log "Adding Local Event Types" do
3
- #change source .csv file as required. Pershaps useful to specify site in filename
4
- file_path = File.join(File.dirname(__FILE__), "event_types_blt.csv")
5
-
6
- CSV.foreach(file_path, headers: true) do |row|
7
- Events::Type.find_or_create_by!(name: row["name"])
8
- end
9
- end
10
- end
@@ -1,17 +0,0 @@
1
- /*
2
- Return any materialized view of function starting with reporting_, and argument names if a function.
3
- This lets us display a list of data sources when defining an audit in the UI, and knowowing the names(s)
4
- of funtion arguments lets us argument grab the corresponding data (from Rails' params) and pass them in
5
- when invoking the argument (used for example in drill down audits.
6
- Note this is not a materiralized view like all the other reporting views.
7
-
8
- Replace the fn type definitions and spaces in the arguments list so e.g.
9
- "x integer, y TEXT" becomes "x,y"
10
- Use a global and case insensitive regex
11
- */
12
- SELECT p.proname as name,
13
- regexp_replace(pg_catalog.pg_get_function_identity_arguments(p.oid), 'boolean|text|integer|date|timestamp|uuid|[ ]', '', 'gi')
14
- FROM (SELECT oid, * FROM pg_proc p WHERE NOT p.proisagg) p
15
- where p.proname ~ '^reporting_'
16
- UNION
17
- SELECT oid::regclass::text, NULL FROM pg_class WHERE relkind = 'm' AND relname ~ '^reporting_'