renalware-forms 0.1.11 → 0.1.15

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: 92ef42b414ec62117acbf04fc22a9bf34e1ca82176a69c02914c564345f6f327
4
- data.tar.gz: c951b4c7190b188bda3d2544e96fe173bf52b19ee3eb77313215c4b5708c738b
3
+ metadata.gz: cb8552f50f455db6eef5e37c00b2dedddfa21b4f833d603b71142d7fc49282db
4
+ data.tar.gz: f70cdcc5f42fab217b1246e6b538658cc8c2c2ab032684ec51f88c6b1e72acf0
5
5
  SHA512:
6
- metadata.gz: 0e834a60b44a5244f9845eb8897624a1a64fba69c2dca49755dab064f61629a78f4bb020624ff007ab4376da87b2dd562f526d068972b848534e5068398c0784
7
- data.tar.gz: 23b9b51811838cc076afb490526bd79adc2943a16038b7be9747122f05ee9c9d00ef84d08b27523346de161a643d680ae0c4c64f84bebd5bd7a56357a58e2b53
6
+ metadata.gz: 23b6c1b7851bbb8a49b795932d0e5164c2750fbd3b52ea5485ca3d1496d99c6cadb2a0517c65fe229435f5db1b921e697cfbcd577035abeae1727cac9b1962f0
7
+ data.tar.gz: 45b5577fa64bbda27fd634a55cbc566355890b9bf58b1d0d119558c4d81ca56c46e57ff43b10ce669b280d03189ef1ea81c08274471f439c1097774353f26973
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ tmp/**/*
2
+ .byebug_history
3
+ .rubocop-https---raw-githubusercontent-com-airslie-styleguide-master-rubocop-yml
4
+ .overcommit.yml
5
+ pkg/renalware-forms-0.1.0.gem
6
+ coverage
7
+ pkg
8
+ .bundle
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,63 @@
1
+ require:
2
+ - rubocop-rails
3
+ - rubocop-rspec
4
+ - rubocop-performance
5
+
6
+ # Note that the local default.yml is overwritten on CodeClimate with the contents of
7
+ # the remote rubocop.yml pulled from GitHub in a codeclimate prepare step.
8
+ inherit_from:
9
+ - default.yml
10
+
11
+ AllCops:
12
+ UseCache: true
13
+ TargetRubyVersion: 3.0
14
+ # Just defining the Exclude or Include keys here overwrites the settings in default.yml
15
+ # so we have to redefine the entire set
16
+ Exclude:
17
+ - "*.gemspec"
18
+ - "vendor/**/*"
19
+ - "bin/**/*"
20
+ - "lib/tasks/**/*"
21
+ - "db/**/*"
22
+ - "spec/dummy/bin/**/*"
23
+ - "spec/dummy/lib/tasks/**/*"
24
+ - "spec/dummy/db/**/*"
25
+ - "tmp/**/*"
26
+ - "spec/dummy/tmp/**/*"
27
+ - "vendor/bundle/**/*"
28
+ - "config/initializers/devise.rb"
29
+
30
+ Layout/LineLength:
31
+ Exclude:
32
+ - "spec/acceptance/renalware/steps/**/*"
33
+
34
+ Metrics/AbcSize:
35
+ Max: 50
36
+ RSpec/ExampleLength:
37
+ Max: 40
38
+ RSpec/NestedGroups:
39
+ Max: 4
40
+ RSpec/MultipleExpectations:
41
+ Max: 20
42
+ RSpec/DescribeClass:
43
+ Enabled: false
44
+ RSpec/ImplicitSubject:
45
+ Enabled: false
46
+ RSpec/DescribedClass:
47
+ Enabled: false
48
+ Performance/RedundantBlockCall:
49
+ Enabled: false
50
+ Style/NumericPredicate:
51
+ Enabled: false
52
+ RSpec/InstanceVariable:
53
+ Enabled: false
54
+ Metrics/MethodLength:
55
+ Max: 50
56
+ Rails/Date:
57
+ Enabled: false
58
+ Rails/TimeZone:
59
+ Enabled: false
60
+ Style/AsciiComments:
61
+ Enabled: false
62
+ Style/ZeroLengthPredicate:
63
+ Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.0.2
@@ -0,0 +1,51 @@
1
+ # Use the latest stable version of Semaphore 2.0 YML syntax:
2
+ version: v1.0
3
+ name: renalware-forms
4
+
5
+ agent:
6
+ machine:
7
+ type: e1-standard-2
8
+ os_image: ubuntu1804
9
+
10
+ blocks:
11
+ - name: Test setup
12
+ task:
13
+ jobs:
14
+ - name: bundle
15
+ commands:
16
+ - checkout
17
+ - cache restore gems-$SEMAPHORE_GIT_BRANCH-$(checksum Gemfile.lock),gems-$SEMAPHORE_GIT_BRANCH-,gems-master-
18
+ - sem-version ruby 3.0.2
19
+ - bundle install --deployment -j 4 --path vendor/bundle
20
+ - cache store gems-$SEMAPHORE_GIT_BRANCH-$(checksum Gemfile.lock) vendor/bundle
21
+
22
+ - name: Tests
23
+ task:
24
+ env_vars:
25
+ - name: RAILS_ENV
26
+ value: test
27
+
28
+ # This secret on semaphore contains the CC_TEST_REPORTER_ID ENV var
29
+ secrets:
30
+ - name: renalware-forms
31
+
32
+ prologue:
33
+ commands:
34
+ - checkout
35
+ - cache restore gems-$SEMAPHORE_GIT_BRANCH-$(checksum Gemfile.lock),gems-$SEMAPHORE_GIT_BRANCH-,gems-master-
36
+ - git submodule sync ; git submodule update --init
37
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
38
+ - chmod +x ./cc-test-reporter
39
+ - ./cc-test-reporter before-build
40
+ - sem-version ruby 3.0.2
41
+ - bundle install --deployment --path vendor/bundle
42
+
43
+ jobs:
44
+ - name: RSpec tests
45
+ commands:
46
+ - bundle exec rspec --format progress
47
+
48
+ epilogue:
49
+ on_pass:
50
+ commands:
51
+ - ./cc-test-reporter after-build
data/CHANGELOG.md ADDED
@@ -0,0 +1,52 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in
4
+ this [changelog](http://keepachangelog.com/en/0.3.0/).
5
+ This project adheres to Semantic Versioning.
6
+
7
+ ## Unreleased
8
+ ### Added
9
+ ### Changed
10
+ ### Fixed
11
+
12
+ ## 0.1.15
13
+ 6 Oct 2021
14
+ ### Added
15
+ ### Changed
16
+ ### Fixed
17
+ - Fixed unresolved constant VERSION
18
+
19
+ ## 0.1.14
20
+ 6 Oct 2021
21
+ ### Added
22
+ ### Changed
23
+ - Switched from dry-types to Virtus
24
+ - Use Ruby 3
25
+
26
+ ### Fixed
27
+ ## 0.1.11
28
+ 3 April 2020
29
+ ### Added
30
+ ### Changed
31
+ - Switched from Virtus to dry-types
32
+ ### Fixed
33
+
34
+ ## 0.1.7
35
+ 31 Mar 2020
36
+ ### Added
37
+ ### Changed
38
+ ### Fixed
39
+ - Remove unused homecare args
40
+
41
+ ## 0.1.6
42
+ 31 Mar 2020
43
+ ### Added
44
+ ### Changed
45
+ ### Fixed
46
+ - Support supplying a selected delivery frequency
47
+
48
+ ## 0.1.3
49
+ ### Added
50
+ ### Changed
51
+ ### Fixed
52
+ - Bring in allergies
data/Gemfile ADDED
@@ -0,0 +1,21 @@
1
+ source "https://rubygems.org"
2
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
3
+
4
+ # Declare your gem's dependencies in renalware-forms.gemspec.
5
+ # Bundler will treat runtime dependencies like base dependencies, and
6
+ # development dependencies will be added by default to the :development group.
7
+ gemspec
8
+
9
+ # Declare any dependencies that are still in development here instead of in
10
+ # your gemspec. These might include edge Rails or gems from your path or
11
+ # Git. Remember to move these dependencies to your gemspec before releasing
12
+ # your gem to rubygems.org.
13
+
14
+ group :development, :test do
15
+ gem "byebug"
16
+ gem "rubocop"
17
+ gem "rubocop-performance"
18
+ gem "rubocop-rails"
19
+ gem "rubocop-rspec"
20
+ gem "simplecov", "~> 0.17.1"
21
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,131 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ renalware-forms (0.1.15)
5
+ activemodel
6
+ attr_extras (~> 6.2)
7
+ prawn (~> 2.2)
8
+ prawn-table (~> 0.2)
9
+ rake
10
+ virtus
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ Ascii85 (1.1.0)
16
+ activemodel (6.1.4.1)
17
+ activesupport (= 6.1.4.1)
18
+ activesupport (6.1.4.1)
19
+ concurrent-ruby (~> 1.0, >= 1.0.2)
20
+ i18n (>= 1.6, < 2)
21
+ minitest (>= 5.1)
22
+ tzinfo (~> 2.0)
23
+ zeitwerk (~> 2.3)
24
+ afm (0.2.2)
25
+ ast (2.4.2)
26
+ attr_extras (6.2.4)
27
+ axiom-types (0.1.1)
28
+ descendants_tracker (~> 0.0.4)
29
+ ice_nine (~> 0.11.0)
30
+ thread_safe (~> 0.3, >= 0.3.1)
31
+ byebug (11.1.3)
32
+ coercible (1.0.0)
33
+ descendants_tracker (~> 0.0.1)
34
+ concurrent-ruby (1.1.9)
35
+ descendants_tracker (0.0.4)
36
+ thread_safe (~> 0.3, >= 0.3.1)
37
+ diff-lcs (1.4.4)
38
+ docile (1.4.0)
39
+ hashery (2.1.2)
40
+ i18n (1.8.10)
41
+ concurrent-ruby (~> 1.0)
42
+ ice_nine (0.11.2)
43
+ json (2.5.1)
44
+ minitest (5.14.4)
45
+ parallel (1.21.0)
46
+ parser (3.0.2.0)
47
+ ast (~> 2.4.1)
48
+ pdf-core (0.9.0)
49
+ pdf-reader (2.5.0)
50
+ Ascii85 (~> 1.0)
51
+ afm (~> 0.2.1)
52
+ hashery (~> 2.0)
53
+ ruby-rc4
54
+ ttfunk
55
+ prawn (2.4.0)
56
+ pdf-core (~> 0.9.0)
57
+ ttfunk (~> 1.7)
58
+ prawn-table (0.2.2)
59
+ prawn (>= 1.3.0, < 3.0.0)
60
+ rack (2.2.3)
61
+ rainbow (3.0.0)
62
+ rake (13.0.6)
63
+ regexp_parser (2.1.1)
64
+ rexml (3.2.5)
65
+ rspec (3.10.0)
66
+ rspec-core (~> 3.10.0)
67
+ rspec-expectations (~> 3.10.0)
68
+ rspec-mocks (~> 3.10.0)
69
+ rspec-core (3.10.1)
70
+ rspec-support (~> 3.10.0)
71
+ rspec-expectations (3.10.1)
72
+ diff-lcs (>= 1.2.0, < 2.0)
73
+ rspec-support (~> 3.10.0)
74
+ rspec-mocks (3.10.2)
75
+ diff-lcs (>= 1.2.0, < 2.0)
76
+ rspec-support (~> 3.10.0)
77
+ rspec-support (3.10.2)
78
+ rubocop (1.22.1)
79
+ parallel (~> 1.10)
80
+ parser (>= 3.0.0.0)
81
+ rainbow (>= 2.2.2, < 4.0)
82
+ regexp_parser (>= 1.8, < 3.0)
83
+ rexml
84
+ rubocop-ast (>= 1.12.0, < 2.0)
85
+ ruby-progressbar (~> 1.7)
86
+ unicode-display_width (>= 1.4.0, < 3.0)
87
+ rubocop-ast (1.12.0)
88
+ parser (>= 3.0.1.1)
89
+ rubocop-performance (1.11.5)
90
+ rubocop (>= 1.7.0, < 2.0)
91
+ rubocop-ast (>= 0.4.0)
92
+ rubocop-rails (2.12.2)
93
+ activesupport (>= 4.2.0)
94
+ rack (>= 1.1)
95
+ rubocop (>= 1.7.0, < 2.0)
96
+ rubocop-rspec (2.5.0)
97
+ rubocop (~> 1.19)
98
+ ruby-progressbar (1.11.0)
99
+ ruby-rc4 (0.1.5)
100
+ simplecov (0.17.1)
101
+ docile (~> 1.1)
102
+ json (>= 1.8, < 3)
103
+ simplecov-html (~> 0.10.0)
104
+ simplecov-html (0.10.2)
105
+ thread_safe (0.3.6)
106
+ ttfunk (1.7.0)
107
+ tzinfo (2.0.4)
108
+ concurrent-ruby (~> 1.0)
109
+ unicode-display_width (2.1.0)
110
+ virtus (2.0.0)
111
+ axiom-types (~> 0.1)
112
+ coercible (~> 1.0)
113
+ descendants_tracker (~> 0.0, >= 0.0.3)
114
+ zeitwerk (2.4.2)
115
+
116
+ PLATFORMS
117
+ ruby
118
+
119
+ DEPENDENCIES
120
+ byebug
121
+ pdf-reader
122
+ renalware-forms!
123
+ rspec
124
+ rubocop
125
+ rubocop-performance
126
+ rubocop-rails
127
+ rubocop-rspec
128
+ simplecov (~> 0.17.1)
129
+
130
+ BUNDLED WITH
131
+ 2.2.28
data/bin/rspec ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require 'bundler/setup'
3
+ load Gem.bin_path('rspec-core', 'rspec')
data/default.yml ADDED
@@ -0,0 +1,6 @@
1
+ inherit_from:
2
+ - https://raw.githubusercontent.com/airslie/styleguide/master/rubocop.yml
3
+
4
+ # Don't add anything to this file other than the inherit_from above
5
+ # as this file is overwritten on CodeClimate with the contents of the above
6
+ # remote url which is downloaded in a CodeClimate prepare step.
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "renalware/forms/version"
4
+
3
5
  module Renalware::Forms::Generic
4
6
  module Homecare::V1
5
7
  class Footer < Base
@@ -6,3 +6,14 @@ module Renalware::Forms::Generic
6
6
  end
7
7
  end
8
8
  end
9
+
10
+ require_relative "v1/base"
11
+ require_relative "v1/allergies"
12
+ require_relative "v1/delivery_frequencies"
13
+ require_relative "v1/document"
14
+ require_relative "v1/footer"
15
+ require_relative "v1/heading"
16
+ require_relative "v1/medications"
17
+ require_relative "v1/patient_details"
18
+ require_relative "v1/prescription_durations"
19
+ require_relative "v1/signoff"
@@ -6,3 +6,5 @@ module Renalware::Forms
6
6
  end
7
7
  end
8
8
  end
9
+
10
+ require_relative "homecare/v1"
@@ -4,3 +4,5 @@ module Renalware::Forms
4
4
  module Generic
5
5
  end
6
6
  end
7
+
8
+ require_relative "generic/homecare"
@@ -1,68 +1,61 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "dry-types"
4
- require "dry-struct"
3
+ require "virtus"
5
4
  require "active_model"
6
5
 
7
6
  # rubocop:disable Metrics/ClassLength
8
7
  module Renalware::Forms
9
- module Types
10
- include Dry.Types()
11
- end
12
-
13
- class Homecare::Args < Dry::Struct
8
+ class Homecare::Args
9
+ include Virtus.model
14
10
  include ActiveModel::Validations
15
11
 
16
- class Medication < Dry::Struct
12
+ class Medication
13
+ include Virtus.model(strict: true)
17
14
  include ActiveModel::Validations
18
15
 
19
- attribute :date, Types::Params::Date
20
- attribute :drug, Types::String
21
- attribute :dose, Types::String
22
- attribute :route, Types::String
23
- attribute :frequency, Types::String
16
+ attribute :date, Date
17
+ attribute :drug, String
18
+ attribute :dose, String
19
+ attribute :route, String
20
+ attribute :frequency, String
24
21
  end
25
22
 
26
23
  # The first 2 attrbutes are used to drive what PDF to build
27
- attribute :provider, Types::Coercible::String
28
- attribute :version, Types::Integer
29
- attribute :title, Types::String.default("")
30
- attribute :given_name, Types::String
31
- attribute :family_name, Types::String
32
- attribute :nhs_number, Types::String.default("")
33
- attribute :born_on, Types::Params::Date
34
- attribute :modality, Types::String.default("")
35
- attribute :telephone, Types::String.default("")
36
- attribute :hospital_number, Types::String.default("")
37
- attribute :address, Types::Array.of(Types::Coercible::String).default([].dup, shared: true)
38
- attribute :postcode, Types::String.default("")
39
- attribute :prescriber_name, Types::String.default("")
40
- attribute :prescription_date, Types::Params::Date
41
- attribute :hospital_name, Types::String.default("")
42
- attribute :hospital_department, Types::String.default("")
43
- attribute :hospital_address, Types::Array.of(Types::Coercible::String).default([], shared: true)
44
- attribute :hospital_telephone, Types::String.default("")
45
- attribute :po_number, Types::String.default("")
46
- attribute :generated_at, (Types::Params::DateTime.default { DateTime.now })
47
- attribute :no_known_allergies, Types::Bool
48
- attribute :allergies, Types::Array.of(Types::Coercible::String)
49
- attribute :drug_type, Types::Coercible::String
50
- # attribute :prescription_duration, Types::String
51
- attribute :administration_device, Types::String.default("")
52
- attribute :medications, Types::Array.of(Medication).default([].dup, shared: true)
53
- attribute :consultant, Types::String.default("")
54
- attribute(
55
- :delivery_frequencies,
56
- Types::Array.of(Types::Coercible::String).default(["3 months", "6 months"].freeze)
57
- )
58
- attribute(
59
- :prescription_durations,
60
- Types::Array
61
- .of(Types::Coercible::String)
62
- .default(["3 months", "6 months", "12 months"].freeze)
63
- )
64
- attribute :selected_prescription_duration, Types::String.default("") # e.g. "6 months"
65
- attribute :selected_delivery_frequency, Types::String.default("") # e.g. "6 months"
24
+ attribute :provider, String
25
+ attribute :version, Integer
26
+ attribute :title, String, default: ""
27
+ attribute :given_name, String
28
+ attribute :family_name, String
29
+ attribute :nhs_number, String, default: ""
30
+ attribute :born_on, Date
31
+ attribute :modality, String, default: ""
32
+ attribute :fmc_patient, String, default: ""
33
+ attribute :telephone, String, default: ""
34
+ attribute :hospital_number, String, default: ""
35
+ attribute :address, Array(String), default: []
36
+ attribute :postcode, String, default: ""
37
+ attribute :modality, String
38
+ attribute :prescriber_name, String, default: ""
39
+ attribute :prescription_date, Date
40
+ attribute :hospital_name, String
41
+ attribute :hospital_department, String
42
+ attribute :hospital_address, Array[String]
43
+ attribute :hospital_telephone, String
44
+ attribute :po_number, String
45
+ attribute :generated_at, DateTime
46
+ attribute :no_known_allergies, Boolean
47
+ attribute :allergies, Array[String]
48
+ attribute :drug_type, String
49
+ attribute :administration_route, String
50
+ attribute :administration_frequency, String
51
+ attribute :prescription_duration, String
52
+ attribute :administration_device, String
53
+ attribute :medications, Array[Medication]
54
+ attribute :consultant, String
55
+ attribute :delivery_frequencies, Array[String], default: ["3 months", "6 months"]
56
+ attribute :selected_delivery_frequency, String # e.g. "6 months"
57
+ attribute :prescription_durations, Array[String] # e.g. ["3 months", "6 months"]
58
+ attribute :selected_prescription_duration, String # e.g. "3 months"
66
59
 
67
60
  validates :family_name, presence: true
68
61
  validates :given_name, presence: true
@@ -94,7 +87,7 @@ module Renalware::Forms
94
87
  end
95
88
 
96
89
  def format_address_array(add)
97
- return unless add&.is_a?(Array)
90
+ return unless add.is_a?(Array)
98
91
 
99
92
  add.compact.reject { |line| line == "" }.uniq&.join("\n")
100
93
  end
@@ -109,59 +102,64 @@ module Renalware::Forms
109
102
  Array(allergies).uniq.compact.join("<br>")
110
103
  end
111
104
 
105
+ # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
112
106
  def self.test_data(provider: :generic, version: 1)
113
- args = new(
114
- provider: provider,
115
- version: version,
116
- title: "Mr",
117
- given_name: "Jack",
118
- family_name: "JONES",
119
- nhs_number: "0123456789",
120
- born_on: Date.parse("2001-01-01"),
121
- telephone: "07000 000001",
122
- hospital_number: "ABC123",
123
- modality: "HD",
124
- address: ["line1", "", nil, "line2", "line3 "],
125
- postcode: "TW1 1UU",
126
- prescriber_name: "Dr X Yz",
127
- prescription_date: Date.today.to_s,
128
- consultant: "Dr Pepper",
129
- hospital_name: "THE ROYAL LONDON HOSPITAL",
130
- hospital_telephone: "0000 000001",
131
- hospital_department: "Renal",
132
- hospital_address: [
133
- "The Royal London Hospital",
134
- "Barts Health NHS Trust",
135
- "Whitechapel",
107
+ new.tap do |args|
108
+ args.provider = provider
109
+ args.version = version
110
+ args.title = "Mr"
111
+ args.given_name = "Jack"
112
+ args.family_name = "JONES"
113
+ args.nhs_number = "0123456789"
114
+ args.born_on = Date.parse("2001-01-01")
115
+ args.fmc_patient = "123"
116
+ args.telephone = "07000 000001"
117
+ args.hospital_number = "ABC123"
118
+ args.modality = "PD"
119
+ args.address = ["line1", "", nil, "line2", "line3 "]
120
+ args.postcode = "TW1 1UU"
121
+ args.modality = "HD"
122
+ args.prescriber_name = "Dr X Yz"
123
+ args.prescription_date = Date.today.to_s
124
+ args.consultant = "Dr Pepper"
125
+ args.hospital_name = "THE ROYAL LONDON HOSPITAL"
126
+ args.hospital_telephone = "0000 000001"
127
+ args.hospital_department = "Renal"
128
+ args.hospital_address = [
129
+ nil,
130
+ "WHITECHAPEL",
131
+ "",
136
132
  "LONDON",
137
133
  "E1 1FR",
138
134
  "UK",
139
135
  "Tel: 0800 00000000",
140
136
  "Another line"
141
- ],
142
- no_known_allergies: false,
143
- allergies: ["Nuts", nil, "Penicillin", "Mown grass"],
144
- drug_type: "ESA",
145
- prescription_duration: "1 month",
146
- administration_device: "device?",
147
- po_number: "P123",
148
- delivery_frequencies: ["1 week", "3 months", "6 months", "12 month"],
149
- prescription_durations: ["3 months", "6 months", "12 months"],
150
- selected_prescription_duration: "6 months",
151
- selected_delivery_frequency: "6 months"
152
- )
153
-
154
- args.medications << Medication.new(
155
- date: Date.today,
156
- drug: "Example drug",
157
- dose: "1 unit",
158
- route: "PO",
159
- frequency: "3"
160
- )
161
-
162
- raise ArgumentError, args.errors unless args.valid?
163
- args
137
+ ]
138
+ args.no_known_allergies = false
139
+ args.allergies = ["Nuts", nil, "Penicillin", "Mown grass"]
140
+ args.drug_type = "ESA"
141
+ args.administration_frequency = "Daily"
142
+ args.administration_route = "Per Oral"
143
+ args.prescription_duration = "1 month"
144
+ args.administration_device = "device?"
145
+ args.po_number = "P123"
146
+ args.generated_at = Time.now
147
+ args.delivery_frequencies = ["1 week", "3 months", "6 months", "12 month"]
148
+ args.prescription_durations = ["3 months", "6 months", "12 months"]
149
+ args.selected_prescription_duration = "6 months"
150
+
151
+ args.medications << Medication.new(
152
+ date: Date.today,
153
+ drug: "Example drug",
154
+ dose: "1 unit",
155
+ route: "PO",
156
+ frequency: "3"
157
+ )
158
+
159
+ raise ArgumentError, args.errors unless args.valid?
160
+ end
164
161
  end
162
+ # rubocop:enable Metrics/AbcSize, Metrics/MethodLength
165
163
 
166
164
  def medications_are_present
167
165
  if medications.size == 0
@@ -1,10 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "prawn"
4
- require "prawn/table"
5
- require "attr_extras"
6
-
7
3
  module Renalware::Forms
8
4
  module Homecare
9
5
  end
10
6
  end
7
+
8
+ require_relative "homecare/args"
9
+ require_relative "homecare/pdf"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Renalware
4
4
  module Forms
5
- VERSION = "0.1.11"
5
+ VERSION = "0.1.15"
6
6
  end
7
7
  end