healthcare_phony 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/healthcare_phony.rb +12 -8
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1de41607d3c9609a86c5cfdefd9562d07c17b30e316d24ea238324c882627d85
4
- data.tar.gz: 353036ecec7fb8c01bf417fcb39d22dfbaec87645d3e500bc00ea47111ad6e62
3
+ metadata.gz: 7ca0b2d6dc3884c2d04d140ac59a78f88abf316ce203c042ae3eeba4b39423bf
4
+ data.tar.gz: c5b7e20a1bf7d070847e1aab071c21536b13cfba5ba8f3536eb84406add20cb5
5
5
  SHA512:
6
- metadata.gz: 0b6064c6bc6770d87cfec29a3ca6539131b80583a2108944ed74bc361a8576aa5d7d46dcf2858e1e62acd8a0bf931a18cef04d464468e623463dad1b60326649
7
- data.tar.gz: 29d10f206bc1b7190a9f08fed733c998919b77c7ece24a282d6bb58a7ef21df1e1ebc287a45bce3305cd71597fd5f477e0865257a471427559a3d78b8f2a8d39
6
+ metadata.gz: c161e48cef5b3f4365aa13693d56ef55ea02c74c7744d5f71caa64f58e84ff6ff4faea6cea409a48d7b879ec71e47aa410a19871eb4017147daf12f34f775df4
7
+ data.tar.gz: 51420c695bc3bf1db62dc8bcbd3ffb0264d1371bbe50d3dea95159f632ecec4b51a861b380ec1eb332a619af576a72a12b2d3291ea259a75548c8fc26359d356
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.4.1
@@ -11,20 +11,24 @@ Faker::Config.locale = 'en-US'
11
11
 
12
12
  module HealthcarePhony
13
13
  class Adt
14
- attr_reader :template_file, :adt_arguments
14
+ attr_reader :template, :adt_arguments
15
15
 
16
16
  def initialize(**init_args)
17
17
  @adt_arguments = init_args
18
18
  @adt_arguments[:message_types] = 'ADT'
19
- @template_file = if adt_arguments[:template_file].nil?
20
- File.join(File.dirname(__FILE__), 'healthcare_phony', 'templates', 'adt_example.erb')
21
- else
22
- adt_arguments[:template_file]
23
- end
19
+ unless adt_arguments[:template].nil?
20
+ @template = adt_arguments[:template]
21
+ return
22
+ end
23
+ @template = if adt_arguments[:template_file].nil?
24
+ File.read(File.join(File.dirname(__FILE__), 'healthcare_phony', 'templates', 'adt_example.erb'))
25
+ else
26
+ File.read(adt_arguments[:template_file])
27
+ end
24
28
  end
25
29
 
26
30
  def to_s
27
- template = ERB.new(File.read(@template_file))
31
+ template = ERB.new(@template)
28
32
  message = Hl7Message.new(@adt_arguments)
29
33
  patient = Patient.new(@adt_arguments)
30
34
  visit = PatientVisit.new(@adt_arguments)
@@ -49,7 +53,7 @@ module HealthcarePhony
49
53
  counter = 0
50
54
  output_string = ''
51
55
  while counter < @number_of_rows
52
- output_string += template.result_with_hash({ patient: Patient.new, write_header: counter == 0 }) + "\n"
56
+ output_string += "#{template.result_with_hash({ patient: Patient.new, write_header: counter.zero? })}\n"
53
57
  counter += 1
54
58
  end
55
59
  output_string
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: healthcare_phony
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Moody
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-17 00:00:00.000000000 Z
11
+ date: 2021-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler