renalware-core 2.0.3 → 2.0.4

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: 03a33697674a37e0920fd04ad84fd5660c6b526e9084ff923e5ec277d8914a27
4
- data.tar.gz: 138b635e40913eba766e0f995b38d14cecbcdf3054a330e35e372a40893a3d5c
3
+ metadata.gz: 99997d94596ca620e3d8aa825949bfab11b9e7d6c3c09249eb66c57a43ae61f9
4
+ data.tar.gz: 2f0945104f2bc36f0fb0e01583ae62ac48b86c53533faf5e83dc149216154d5c
5
5
  SHA512:
6
- metadata.gz: 19b2535e3b70433394f48cf4f74e714b3ca033c38d67cb43ea09a37a6070ea3bc32f678e1af665118d803615da213bec6241a80c8d101b336f5bdbdd43600718
7
- data.tar.gz: f4ac2e6ef943e8c77e0c9f6b4ac8b0b860327fb19f7e3dc49f14c7ac2fe20c2e88ae6061facc707ef7040b01d4e0fa0ae5cbb8deda01b8228bf3ac6df7e400e8
6
+ metadata.gz: 5066afacd3a1591643cd489cb4b5711fa864061c2751c60fefa78814031088ccc513b8360c4e0f3db2575932708cca253032bf8507682fe743cbe886bd7a497a
7
+ data.tar.gz: 1f3f7ae72253ad1d0805f7e9b03b661c3e39f84caccb0faf343e6b4f591104c2b37001f44b8f44a7963e52e1966660be10d56e1fd3ef9be9dae762eb15e16ef0
@@ -218,6 +218,29 @@ ul.provider {
218
218
  }
219
219
  }
220
220
  }
221
+
222
+ &.hospital_no {
223
+ display: inline-block;
224
+ margin-right: .6em;
225
+ margin-left: 0;
226
+ margin-top: .1rem;
227
+
228
+ dt, dd {
229
+ display: block;
230
+ padding: 0;
231
+ margin: 0;
232
+ }
233
+ dd {
234
+ font-size: 1em;
235
+ line-height: 0.9rem;
236
+ }
237
+
238
+ @media #{$medium-only} {
239
+ dd {
240
+ line-height: 0.7rem;
241
+ }
242
+ }
243
+ }
221
244
  }
222
245
 
223
246
  .menu-icon {
@@ -33,6 +33,7 @@ module Renalware
33
33
  end
34
34
 
35
35
  def edit
36
+ session[:consults_results] = request&.referer # for back link
36
37
  render_edit(find_and_authorize_consult)
37
38
  end
38
39
 
@@ -46,7 +47,7 @@ module Renalware
46
47
  end
47
48
 
48
49
  def destroy
49
- find_and_authorize_consult.destroy!
50
+ find_and_authorize_consult.update!(ended_on: Time.zone.now, by: current_user)
50
51
  redirect_to admissions_consults_path, notice: success_msg_for("consult")
51
52
  end
52
53
 
@@ -5,7 +5,6 @@ module Renalware
5
5
  class Consult < ApplicationRecord
6
6
  include Accountable
7
7
  extend Enumerize
8
- acts_as_paranoid
9
8
  validates :patient_id, presence: true
10
9
  validates :started_on, presence: true
11
10
  validates :description, presence: true
@@ -21,6 +20,9 @@ module Renalware
21
20
 
22
21
  enumerize :transfer_priority, in: %i(unknown necessary desirable potential unnecessary)
23
22
  enumerize :aki_risk, in: %i(yes no unknown)
23
+
24
+ scope :active, ->{ where(ended_on: nil) }
25
+
24
26
  end
25
27
  end
26
28
  end
@@ -14,7 +14,7 @@ module Renalware
14
14
  end
15
15
 
16
16
  def search
17
- @search ||= Consult.order(created_at: :desc).ransack(query)
17
+ @search ||= Consult.active.order(created_at: :desc).ransack(query)
18
18
  end
19
19
  end
20
20
  end
@@ -46,7 +46,7 @@ module Renalware
46
46
 
47
47
  class Dialysis < Renalware::HD::SessionDocument::Dialysis
48
48
  # rubocop:disable Rails/Validation
49
- validates_presence_of attribute_set.map(&:name)
49
+ validates_presence_of attribute_set.map(&:name).reject{ |att| att == :machine_ktv }
50
50
  # rubocop:enable Rails/Validation
51
51
  end
52
52
  attribute :dialysis, Dialysis
@@ -21,17 +21,18 @@ module Renalware
21
21
  has_document class_name: "Renalware::Transplants::RecipientOperationDocument"
22
22
 
23
23
  validates :performed_on, presence: true
24
- validates :theatre_case_start_time, presence: true
25
- validates :donor_kidney_removed_from_ice_at, presence: true
26
- validates :kidney_perfused_with_blood_at, presence: true
27
24
  validates :operation_type, presence: true
28
25
  validates :hospital_centre, presence: true
29
- validates :cold_ischaemic_time_formatted, presence: true
30
- validates :warm_ischaemic_time_formatted, presence: true
31
26
 
32
- validates :donor_kidney_removed_from_ice_at, timeliness: { type: :datetime }
33
- validates :kidney_perfused_with_blood_at, timeliness: { type: :datetime }
34
- validates :theatre_case_start_time, timeliness: { type: :time }
27
+ validates :donor_kidney_removed_from_ice_at,
28
+ timeliness: { type: :datetime },
29
+ allow_blank: true
30
+ validates :kidney_perfused_with_blood_at,
31
+ timeliness: { type: :datetime },
32
+ allow_blank: true
33
+ validates :theatre_case_start_time,
34
+ timeliness: { type: :time },
35
+ allow_blank: true
35
36
 
36
37
  enumerize :operation_type,
37
38
  in: %i(kidney kidney_dual kidney_pancreas pancreas kidney_liver liver)
@@ -22,6 +22,11 @@
22
22
  include_blank: true,
23
23
  collection: Renalware::Admissions::Consult.aki_risk.values.map{ |value| [value.text, value] },
24
24
  label: "AKI Risk"
25
+ / .columns.medium-2.large-1
26
+ / = f.input :stopped_on_eq_nil,
27
+ / include_blank: false,
28
+ / collection: [["Yes", true], ["No", false]],
29
+ / label: "Active"
25
30
  .columns.medium-2.large-2.actions.end
26
31
  = f.submit "Filter", class: "button"
27
32
  span= " or "
@@ -2,10 +2,12 @@
2
2
  table
3
3
  thead
4
4
  tr
5
- th.col-width-large= sort_link(query, :consult_site_id, "Location")
5
+ th= sort_link(query, :consult_site_id, "Location")
6
6
  th.at-least.col-width-medium Patient
7
7
  th.col-width-nhs-no NHS No.
8
8
  th.col-width-reference-no Hosp Nos.
9
+ th.col-width-date Started
10
+ th.col-width-date Ended
9
11
  th.col-width-medium Modality
10
12
  th.col-width-tiny Sex
11
13
  th.col-width-tiny Age
@@ -22,6 +24,8 @@
22
24
  td= consult.patient_name
23
25
  td= consult.patient_nhs_number
24
26
  td= consult.patient_hospital_identifiers
27
+ td= l(consult.started_on)
28
+ td= l(consult.ended_on)
25
29
  td= consult.patient_current_modality
26
30
  td= consult.patient_sex
27
31
  td= consult.patient_age
@@ -1,6 +1,11 @@
1
+
1
2
  = within_admin_layout( \
2
3
  title: "Edit",
3
4
  breadcrumbs: breadcrumb_for("Admission Consults", admissions_consults_path) \
4
5
  ) do
5
6
 
7
+ = link_to "< Back to search results",
8
+ session[:consults_results] || admissions_consults_path,
9
+ class: "button secondary"
10
+ br
6
11
  = render "form", consult: consult
@@ -16,8 +16,14 @@
16
16
  a
17
17
  i.fa.fa-ellipsis-v
18
18
  = patient
19
- dt= patient.hospital_identifier.name
20
- dd= patient.hospital_identifier.id
19
+ - if patient.hospital_identifiers.all.count > 1
20
+ - patient.hospital_identifiers.all.each do |hospital_identifier|
21
+ dl.hospital_no
22
+ dt= hospital_identifier[0]
23
+ dd= hospital_identifier[1]
24
+ - else
25
+ dt= patient.hospital_identifier.name
26
+ dd= patient.hospital_identifier.id
21
27
  dt= t(".nhs_number")
22
28
  dd= formatted_nhs_number(patient)
23
29
  dt= t(".sex")
@@ -0,0 +1,5 @@
1
+ class RemoveDeletedAtFromAdmissionConsults < ActiveRecord::Migration[5.1]
2
+ def change
3
+ remove_column :admission_consults, :deleted_at, :datetime
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class RemoveTxOperationConstraints < ActiveRecord::Migration[5.1]
2
+ def change
3
+ change_column_null :transplant_recipient_operations, :theatre_case_start_time, true
4
+ change_column_null :transplant_recipient_operations, :donor_kidney_removed_from_ice_at, true
5
+ change_column_null :transplant_recipient_operations, :kidney_perfused_with_blood_at, true
6
+ change_column_null :transplant_recipient_operations, :warm_ischaemic_time, true
7
+ change_column_null :transplant_recipient_operations, :cold_ischaemic_time, true
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Renalware
2
- VERSION = "2.0.3".freeze
2
+ VERSION = "2.0.4".freeze
3
3
  end
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.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Airslie
@@ -3194,6 +3194,8 @@ files:
3194
3194
  - db/migrate/20180309140316_add_unique_constraint_to_obr_requestor.rb
3195
3195
  - db/migrate/20180311071146_update_patient_summaries_to_version6.rb
3196
3196
  - db/migrate/20180311104609_remove_unique_obr_requestor_order_number_index.rb
3197
+ - db/migrate/20180313114927_remove_deleted_at_from_admission_consults.rb
3198
+ - db/migrate/20180313124819_remove_tx_operation_constraints.rb
3197
3199
  - db/seeds.rb
3198
3200
  - db/seeds/default/accesses/access_pd_catheter_insertion_techniques.csv
3199
3201
  - db/seeds/default/accesses/access_pd_catheter_insertion_techniques.rb