renalware-core 2.0.78 → 2.0.79

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/renalware/application.js.erb +1 -0
  4. data/app/assets/javascripts/renalware/layout.js +3 -0
  5. data/app/assets/stylesheets/renalware/modules/_patients.scss +2 -1
  6. data/app/controllers/renalware/admin/feeds/files_controller.rb +7 -1
  7. data/app/controllers/renalware/patients/practices_controller.rb +1 -1
  8. data/app/controllers/renalware/patients/primary_care_physician_controller.rb +32 -13
  9. data/app/controllers/renalware/virology/dashboards_controller.rb +1 -4
  10. data/app/controllers/renalware/virology/profiles_controller.rb +10 -5
  11. data/app/documents/renalware/hd/session_document.rb +4 -0
  12. data/app/documents/renalware/patient_document.rb +15 -1
  13. data/app/documents/renalware/renal/profile_document.rb +22 -0
  14. data/app/documents/renalware/virology/profile_document.rb +1 -0
  15. data/app/models/renalware/clinics/remembered_clinic_visit_preferences.rb +1 -1
  16. data/app/models/renalware/feeds/files/practice_memberships/import_job.rb +2 -8
  17. data/app/models/renalware/feeds/files/primary_care_physicians/import_csv.rb +2 -2
  18. data/app/models/renalware/hd/session/closed.rb +2 -0
  19. data/app/models/renalware/patients/last_successful_practice_sync_date_query.rb +28 -0
  20. data/app/models/renalware/patients/practice.rb +0 -2
  21. data/app/models/renalware/patients/practice_search_query.rb +4 -2
  22. data/app/models/renalware/patients/sync_gps_via_file_download_job.rb +52 -0
  23. data/app/models/renalware/patients/sync_ods_job.rb +53 -0
  24. data/app/models/renalware/patients/sync_practices_via_api.rb +157 -0
  25. data/app/models/renalware/system/api_log.rb +29 -0
  26. data/app/presenters/renalware/admissions/consult_summary_part.rb +36 -0
  27. data/app/presenters/renalware/ukrdc/patient_presenter.rb +66 -6
  28. data/app/presenters/renalware/virology/dashboard_presenter.rb +32 -0
  29. data/app/validators/renalware/patients/respiratory_rate_validator.rb +17 -0
  30. data/app/views/renalware/admissions/consults/_summary_part.html.slim +17 -0
  31. data/app/views/renalware/admissions/consults/_table.html.slim +58 -19
  32. data/app/views/renalware/api/ukrdc/patients/_diagnoses.xml.builder +43 -3
  33. data/app/views/renalware/api/ukrdc/patients/_medications.xml.builder +23 -3
  34. data/app/views/renalware/api/ukrdc/patients/_social_histories.xml.builder +2 -2
  35. data/app/views/renalware/hd/protocols/_virology.html.slim +2 -0
  36. data/app/views/renalware/hd/sessions/_form.html.slim +4 -0
  37. data/app/views/renalware/pathology/historical_observation_results/index.html.slim +2 -2
  38. data/app/views/renalware/virology/dashboards/_latest_hep_b_antibody_statuses.html.slim +5 -0
  39. data/app/views/renalware/virology/dashboards/show.html.slim +6 -3
  40. data/app/views/renalware/virology/profiles/_summary.html.slim +2 -2
  41. data/app/views/renalware/virology/profiles/edit.html.slim +1 -0
  42. data/config/locales/renalware/hd/session.en.yml +4 -0
  43. data/config/locales/renalware/virology/virology.en.yml +1 -0
  44. data/db/functions/import_practice_memberships_csv_v03.sql +65 -0
  45. data/db/migrate/20190531172829_add_last_change_date_to_patient_practices.rb +26 -0
  46. data/db/migrate/20190602114659_create_system_api_logs.rb +15 -0
  47. data/db/migrate/20190603084428_add_pages_to_system_api_logs.rb +5 -0
  48. data/db/migrate/20190603135247_add_columns_to_patient_primary_care_physicians.rb +8 -0
  49. data/db/migrate/20190603143834_update_import_practice_memberships_csv.rb +13 -0
  50. data/db/migrate/20190603165812_drop_import_practices_csv_function.rb +13 -0
  51. data/db/seeds/default/feeds/import_file_types.rb +0 -8
  52. data/db/seeds/default/renal/prd_descriptions.csv +266 -266
  53. data/lib/document/enum.rb +4 -0
  54. data/lib/renalware/configuration.rb +1 -0
  55. data/lib/renalware/version.rb +1 -1
  56. data/lib/tasks/feeds/files.rake +0 -16
  57. data/lib/tasks/hd.rake +2 -0
  58. data/lib/tasks/ods.rake +10 -0
  59. data/spec/factories/feeds/file.rb +0 -4
  60. data/spec/factories/feeds/file_types.rb +2 -7
  61. data/spec/factories/hd/hd_session_document.rb +2 -0
  62. data/spec/factories/system/api_logs.rb +19 -0
  63. data/spec/support/pathology_spec_helper.rb +12 -8
  64. data/vendor/assets/javascripts/renalware/double_scroll.js +128 -0
  65. metadata +23 -9
  66. data/app/models/renalware/feeds/files/practices/convert_xml_to_csv.rb +0 -153
  67. data/app/models/renalware/feeds/files/practices/country_map.rb +0 -36
  68. data/app/models/renalware/feeds/files/practices/csv_file.rb +0 -25
  69. data/app/models/renalware/feeds/files/practices/csv_organisation.rb +0 -37
  70. data/app/models/renalware/feeds/files/practices/import_csv.rb +0 -32
  71. data/app/models/renalware/feeds/files/practices/import_job.rb +0 -61
  72. data/app/models/renalware/feeds/files/practices/xml_parser.rb +0 -102
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6fc5fdac47309549e33a38115213df8faa51bf106f66e354a41b594687938168
4
- data.tar.gz: d6d87b6b9199f3f95e5ee6cf88b3a553eb819814db336e974e763fa35c5cc36b
3
+ metadata.gz: e498f337dc6db41cfb6478cd0241f19693a22f284ff95941a1756c32beb057d5
4
+ data.tar.gz: 45bf39706420b19adc516e7e2fc2effd4c095392a675d01af1e1a64892ba0420
5
5
  SHA512:
6
- metadata.gz: 5e73f7af79c6b2ce7654949780644d3de0992015e833a33741c6463dfd95676e4ae15d74d07ee80833f492e8c07aedd13545207b926600bb854e58f7a0b9def5
7
- data.tar.gz: 41f49f78bab0117ee76308dcb1ae38009588098f197e28821a0cf11351549a16434f8001c01458b4915db06639e6e9f8bd0d7fc72f1f27fb0f438661cd75ffa6
6
+ metadata.gz: 6ba0afc1c09b0f94252f359d6ca2412906e668c437913a11115ba3174325ed27e441ea29e9e895e07a9e9ca1b6a259ed622be7d31dbe3fc3dc9dd0d4a5906293
7
+ data.tar.gz: a14cb7fa2f36d3d40b3939715e485804b713b148dcd54dd68420eba7f1007a6cfbf31dde473952805ce79cae497276ae004e0734ee120f42b4affbe1c016a3d3
data/README.md CHANGED
@@ -123,7 +123,7 @@ On a Mac:
123
123
  - Download chromedriver from eg [here](https://chromedriver.storage.googleapis.com/index.html?path=2.38/)
124
124
  - Unzip and place in location in your PATH eh `/usr/local/bin`
125
125
  - If you have chromedriver errors it maybe your installed version of Chrome is not
126
- compatible your chromedriver version. In this case check your versions with
126
+ compatible your chromedriver version. In this case check your versions with:
127
127
 
128
128
  ```
129
129
  chromedriver -v
@@ -36,6 +36,7 @@
36
36
  //= require jquery_nested_form
37
37
  //= require foundation-datepicker
38
38
  //= require renalware/clockpicker
39
+ //= require renalware/double_scroll
39
40
  //= require cocoon
40
41
  //= require mousetrap
41
42
  //= require renalware/iframeResizer
@@ -0,0 +1,3 @@
1
+ $(document).ready(function() {
2
+ $('.double-scroll').doubleScroll({ resetOnWindowResize: true });
3
+ });
@@ -368,7 +368,8 @@ form {
368
368
  }
369
369
 
370
370
  .summary-part--events,
371
- .summary-part--admissions {
371
+ .summary-part--admissions,
372
+ .summary-part--consults {
372
373
  @include grid-column(12);
373
374
 
374
375
  @media #{$xxlarge-up} {
@@ -39,7 +39,13 @@ module Renalware
39
39
  private
40
40
 
41
41
  def files
42
- @files ||= Renalware::Feeds::File.ordered.page(page).per(per_page)
42
+ @files ||= begin
43
+ Renalware::Feeds::File
44
+ .ordered
45
+ .includes(:file_type, :created_by)
46
+ .page(page)
47
+ .per(per_page)
48
+ end
43
49
  end
44
50
 
45
51
  def file_upload_params
@@ -31,7 +31,7 @@ module Renalware
31
31
  address = practice.address || null_address
32
32
  {
33
33
  id: practice.id,
34
- name: practice.name,
34
+ name: "#{practice.name} (#{practice.code})",
35
35
  address: [
36
36
  address.street_1,
37
37
  address.town,
@@ -35,10 +35,8 @@ module Renalware
35
35
  # So to allow the Practice and GP to be assigned to such a patient we have to skip validation
36
36
  # callbacks by using update_columns.
37
37
  def update_patient
38
- return false unless selected_pyhsician
39
-
40
38
  patient.update_columns(
41
- primary_care_physician_id: selected_pyhsician.id,
39
+ primary_care_physician_id: selected_physician_id,
42
40
  practice_id: patient_params[:practice_id],
43
41
  updated_by_id: current_user.id
44
42
  )
@@ -56,9 +54,12 @@ module Renalware
56
54
  }
57
55
  end
58
56
 
59
- def selected_pyhsician
60
- @selected_pyhsician ||= begin
61
- PrimaryCarePhysician.find_by(id: patient_params[:primary_care_physician_id])
57
+ def selected_physician_id
58
+ @selected_physician_id ||= begin
59
+ PrimaryCarePhysician
60
+ .select(:id)
61
+ .find_by(id: patient_params[:primary_care_physician_id])
62
+ &.id
62
63
  end
63
64
  end
64
65
 
@@ -67,20 +68,38 @@ module Renalware
67
68
  end
68
69
 
69
70
  # Every time a practice is selected from the autocomplete list in the Find GP modal
70
- # we re-render the edit form and inject the practice_id as a hidden field therein. This was
71
- # its available in a form submission in the #update action.
71
+ # we re-render the edit form and inject the practice_id as a hidden field therein so it
72
+ # is available in a form submission in the #update action.
72
73
  # The practice_id in this method is supplied here as a query param by the JS that refreshes
73
74
  # the form when a practice is selected - it will be the same as that posted in the form when
74
- # saved, but at this stage its ephemeral and just here to let us build the PCP list to
75
+ # saved, but at this stage its ephemeral and just here to let us build the GP list to
75
76
  # render in the form.
76
77
  def available_primary_care_physicians
77
- pratice_id = params[:practice_id]
78
- return [] unless pratice_id
78
+ practice_id = params[:practice_id]
79
+ return [] unless practice_id
79
80
 
80
- Practice.find(pratice_id).primary_care_physicians.map do |physician|
81
- [physician.to_s, physician.id]
81
+ find_practice_memberships_for(practice_id).map do |membership|
82
+ [
83
+ format_gp_name(membership),
84
+ membership.primary_care_physician&.id
85
+ ]
82
86
  end
83
87
  end
88
+
89
+ def find_practice_memberships_for(practice_id)
90
+ PracticeMembership
91
+ .eager_load(:primary_care_physician)
92
+ .where(practice_id: practice_id)
93
+ .order(
94
+ "#{PracticeMembership.table_name}.left_on desc,"\
95
+ "#{PrimaryCarePhysician.table_name}.name asc"
96
+ )
97
+ end
98
+
99
+ def format_gp_name(membership)
100
+ left_on = " (Left #{I18n.l(membership.left_on)})" if membership.left_on.present?
101
+ "#{membership.primary_care_physician}#{left_on}"
102
+ end
84
103
  end
85
104
  end
86
105
  end
@@ -7,10 +7,7 @@ module Renalware
7
7
  class DashboardsController < BaseController
8
8
  def show
9
9
  authorize [:renalware, :virology, :dashboard], :show?
10
- render locals: {
11
- patient: patient,
12
- vaccinations: Vaccination.for_patient(patient)
13
- }
10
+ render locals: { dashboard: DashboardPresenter.new(patient) }
14
11
  end
15
12
  end
16
13
  end
@@ -32,15 +32,20 @@ module Renalware
32
32
  end
33
33
 
34
34
  def update_profile(profile)
35
- document_params = profile_params[:document]
36
35
  document = profile.document
37
- document.hiv = YearDatedDiagnosis.new(document_params[:hiv])
38
- document.hepatitis_b = YearDatedDiagnosis.new(document_params[:hepatitis_b])
39
- document.hepatitis_c = YearDatedDiagnosis.new(document_params[:hepatitis_c])
40
- document.htlv = YearDatedDiagnosis.new(document_params[:htlv])
36
+ document.hiv = year_date_diagnosis_for(:hiv)
37
+ document.hepatitis_b = year_date_diagnosis_for(:hepatitis_b)
38
+ document.hepatitis_b_core_antibody = year_date_diagnosis_for(:hepatitis_b_core_antibody)
39
+ document.hepatitis_c = year_date_diagnosis_for(:hepatitis_c)
40
+ document.htlv = year_date_diagnosis_for(:htlv)
41
41
  profile.save_by(current_user)
42
42
  end
43
43
 
44
+ def year_date_diagnosis_for(condition)
45
+ document_params = profile_params[:document]
46
+ YearDatedDiagnosis.new(document_params[condition])
47
+ end
48
+
44
49
  def profile_params
45
50
  params.require(:virology_profile).permit(document: {})
46
51
  end
@@ -34,11 +34,14 @@ module Renalware
34
34
  attribute :temperature, Float
35
35
  attribute :temperature_measured, Document::Enum, enums: %i(yes no), default: :yes
36
36
  attribute :bm_stix, Float
37
+ attribute :respiratory_rate, Integer
38
+ attribute :respiratory_rate_measured, Document::Enum, enums: %i(yes no), default: :yes
37
39
 
38
40
  %i(
39
41
  weight
40
42
  temperature
41
43
  bm_stix
44
+ respiratory_rate
42
45
  pulse
43
46
  ).each { |att| validates(att, numericality: { allow_blank: true }) }
44
47
 
@@ -46,6 +49,7 @@ module Renalware
46
49
  validates :temperature, "renalware/patients/temperature" => true
47
50
  validates :bm_stix, "renalware/patients/bm_stix" => true
48
51
  validates :pulse, "renalware/patients/pulse" => true
52
+ validates :respiratory_rate, "renalware/patients/respiratory_rate" => true
49
53
  end
50
54
  attribute :observations_before, Observations
51
55
  attribute :observations_after, Observations
@@ -28,8 +28,22 @@ module Renalware
28
28
  attribute :psychosocial, Psychosocial
29
29
 
30
30
  class History < Document::Embedded
31
+ SMOKING_SNOMED_MAP = {
32
+ "yes" => { code: 77176002, description: "Current" },
33
+ "no" => { code: 8392000, description: "Non" },
34
+ "ex" => { code: 8517006, description: "Ex" }
35
+ }.freeze
36
+
31
37
  attribute :alcohol, Document::Enum, enums: %i(never rarely social heavy)
32
- attribute :smoking, Document::Enum, enums: %i(no ex yes) # RRSMOKING %i(never former current)
38
+ attribute :smoking, Document::Enum, enums: %i(no ex yes)
39
+
40
+ def smoking_snomed
41
+ SMOKING_SNOMED_MAP[@smoking]
42
+ end
43
+
44
+ def smoking_rr
45
+ @smoking&.upcase
46
+ end
33
47
  end
34
48
  attribute :history, History
35
49
  end
@@ -7,6 +7,24 @@ module Renalware
7
7
  module Renal
8
8
  class ProfileDocument < Document::Embedded
9
9
  class Comorbidities < Document::Embedded
10
+ SMOMED_MAP = {
11
+ diabetes: 73211009,
12
+ ischaemic_heart_dis: 414545008,
13
+ cabg_or_angioplasty: 232717009,
14
+ heart_failure: 84114007,
15
+ atrial_fibrill: 49436004,
16
+ malignancy: 86049000,
17
+ cerebrovascular_dis: 62914000,
18
+ chronic_obstr_pulm_dis: 13645005,
19
+ liver_disease: 235856003,
20
+ periph_vascular_dis: 400047006,
21
+ amputation_for_pvd: 81723002,
22
+ claudication: 275520000,
23
+ ischaemic_neuropathic_ulcers: 13954005,
24
+ non_coronary_intervention: 418285008,
25
+ dementia: 52448006
26
+ }.freeze
27
+
10
28
  attribute :diabetes, YearDatedConfirmation
11
29
  attribute :ischaemic_heart_dis, YearDatedConfirmation
12
30
  attribute :cabg_or_angioplasty, YearDatedConfirmation
@@ -23,6 +41,10 @@ module Renalware
23
41
  attribute :non_coronary_intervention, YearDatedConfirmation
24
42
  attribute :dementia, YearDatedConfirmation
25
43
  attribute :smoking, SmokingStatus
44
+
45
+ def self.snomed_code_for(att)
46
+ SMOMED_MAP[att]
47
+ end
26
48
  end
27
49
  attribute :comorbidities, Comorbidities
28
50
  end
@@ -8,6 +8,7 @@ module Renalware
8
8
  class ProfileDocument < Document::Embedded
9
9
  attribute :hiv, YearDatedDiagnosis
10
10
  attribute :hepatitis_b, YearDatedDiagnosis
11
+ attribute :hepatitis_b_core_antibody, YearDatedDiagnosis
11
12
  attribute :hepatitis_c, YearDatedDiagnosis
12
13
  attribute :htlv, YearDatedDiagnosis
13
14
  end
@@ -6,7 +6,7 @@ module Renalware
6
6
  module Clinics
7
7
  class RememberedClinicVisitPreferences < RememberedPreferences
8
8
  SESSION_KEY = :clinic_visit_preferences
9
- ATTRIBUTES_TO_REMEMBER = %i(date).freeze
9
+ ATTRIBUTES_TO_REMEMBER = %i(date clinic_id).freeze
10
10
  end
11
11
  end
12
12
  end
@@ -13,13 +13,11 @@ module Renalware
13
13
 
14
14
  def perform(file)
15
15
  logging_to_stringio(strio = StringIO.new)
16
- log "Before upload there are #{practice_membership_count} active and "\
17
- "#{inactive_practice_membership_count} inactive practice memberships"
16
+ log "Before upload there are #{practice_membership_count} practice memberships"
18
17
  file.update!(status: :processing, attempts: file.attempts + 1)
19
18
  status = :success
20
19
  elapsed_ms = Benchmark.ms { process_archive(file.location) }
21
- log "After upload there are #{practice_membership_count} active and "\
22
- "#{inactive_practice_membership_count} inactive practice memberships"
20
+ log "After upload there are #{practice_membership_count} practice memberships"
23
21
  rescue StandardError => e
24
22
  Rails.logger.error(formatted_exception(e))
25
23
  status = :failure
@@ -40,10 +38,6 @@ module Renalware
40
38
  def practice_membership_count
41
39
  Patients::PracticeMembership.count
42
40
  end
43
-
44
- def inactive_practice_membership_count
45
- Patients::PracticeMembership.deleted.count
46
- end
47
41
  end
48
42
  end
49
43
  end
@@ -11,13 +11,13 @@ module Renalware
11
11
  pattr_initialize :csv_path
12
12
 
13
13
  def call
14
- import_practices_csv_using_sql_function
14
+ import_gp_csv_using_sql_function
15
15
  end
16
16
 
17
17
  private
18
18
 
19
19
  # See migration for SQL function definition
20
- def import_practices_csv_using_sql_function
20
+ def import_gp_csv_using_sql_function
21
21
  conn = ActiveRecord::Base.connection
22
22
  conn.execute(
23
23
  "SELECT renalware.import_gps_csv(#{conn.quote(csv_path.realpath.to_s)}::text)"
@@ -45,6 +45,8 @@ module Renalware
45
45
  validates :blood_pressure, presence: true
46
46
  validates :weight_measured, presence: true
47
47
  validates :temperature_measured, presence: true
48
+ validates :respiratory_rate_measured, presence: true
49
+ validates :respiratory_rate, presence: { if: -> { respiratory_rate_measured&.yes? } }
48
50
  validates :weight, presence: { if: -> { weight_measured&.yes? } }
49
51
  validates :temperature, presence: { if: -> { temperature_measured&.yes? } }
50
52
  validates :blood_pressure, "renalware/patients/blood_pressure_presence" => true
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "attr_extras"
4
+
5
+ module Renalware
6
+ module Patients
7
+ class LastSuccessfulPracticeSyncDateQuery
8
+ pattr_initialize :identifier
9
+
10
+ def call
11
+ max_created_at&.to_date&.to_s
12
+ end
13
+
14
+ private
15
+
16
+ def max_created_at
17
+ System::APILog
18
+ .where(
19
+ identifier: identifier,
20
+ dry_run: false,
21
+ status: Renalware::System::APILog::STATUS_DONE
22
+ )
23
+ .group(:identifier)
24
+ .maximum(:created_at)[identifier]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -5,8 +5,6 @@ require_dependency "renalware/patients"
5
5
  module Renalware
6
6
  module Patients
7
7
  class Practice < ApplicationRecord
8
- acts_as_paranoid
9
-
10
8
  has_one :address, as: :addressable
11
9
  has_many :practice_memberships, dependent: :restrict_with_exception
12
10
  has_many :primary_care_physicians, through: :practice_memberships
@@ -13,12 +13,14 @@ module Renalware
13
13
  return [] if search_term.blank?
14
14
 
15
15
  term = "%#{search_term}%"
16
- Practice.select(:id, :name)
16
+ Practice.select(:id, :name, :code)
17
17
  .left_outer_joins(:address)
18
18
  .includes(:address)
19
19
  .where("patient_practices.name ILIKE ? "\
20
+ "OR patient_practices.code = ? " \
20
21
  "OR addresses.street_1 ILIKE ? " \
21
- "OR addresses.postcode ILIKE ?", term, term, term)
22
+ "OR addresses.postcode ILIKE ?", term, search_term, term, term)
23
+ .where(active: true)
22
24
  .limit(50)
23
25
  end
24
26
  end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_dependency "renalware/patients"
4
+
5
+ module Renalware
6
+ module Patients
7
+ class SyncGpsViaFileDownloadJob < ApplicationJob
8
+ ODS_DOWNLOADABLES = {
9
+ primary_care_physicians: {
10
+ url: "https://files.digital.nhs.uk/assets/ods/current/egpcur.zip",
11
+ filename: "egpcur.zip"
12
+ },
13
+ practice_memberships: {
14
+ url: "https://files.digital.nhs.uk/assets/ods/current/epracmem.zip",
15
+ filename: "epracmem.zip"
16
+ }
17
+ }.freeze
18
+
19
+ # Do not retry this job
20
+ discard_on(StandardError) do |_job, exception|
21
+ Renalware::Engine.exception_notifier.notify(exception)
22
+ Rails.logger.error exception
23
+ end
24
+
25
+ # Now we have brought practices up to date, update GPs and their membership in practices.
26
+ # Download the relevant zip file, save it as a Feeds::File (the zip file will be copied to
27
+ # the uploads dir) and kick off a sync job to import the data, which it does by unzipping
28
+ # the file, extracting the csv and using a PG function to upsert the contents.
29
+ # Note we cannot reliably use an aysnc job here as the order of execution of the 3 updates -
30
+ # practices, gps, practice memberships - is strict.
31
+ def perform
32
+ ODS_DOWNLOADABLES.each do |type, options|
33
+ # Download the ODS file to a temporary location
34
+ tmp_file = Rails.root.join("tmp").join(options[:filename])
35
+ `wget -O #{tmp_file} #{options[:url]}`
36
+ file = create_feed_file(type, tmp_file)
37
+ Renalware::Feeds::Files::ImportJobFactory.job_class_for(file.file_type).perform_now(file)
38
+ end
39
+ end
40
+
41
+ private
42
+
43
+ def create_feed_file(type, tmp_file)
44
+ Renalware::Feeds::Files::CreateFeedFile.call(
45
+ uploaded_file: tmp_file,
46
+ file_type: Renalware::Feeds::FileType.find_by(name: type),
47
+ user: Renalware::SystemUser.find
48
+ )
49
+ end
50
+ end
51
+ end
52
+ end