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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/healthcare_phony.rb +12 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ca0b2d6dc3884c2d04d140ac59a78f88abf316ce203c042ae3eeba4b39423bf
|
4
|
+
data.tar.gz: c5b7e20a1bf7d070847e1aab071c21536b13cfba5ba8f3536eb84406add20cb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c161e48cef5b3f4365aa13693d56ef55ea02c74c7744d5f71caa64f58e84ff6ff4faea6cea409a48d7b879ec71e47aa410a19871eb4017147daf12f34f775df4
|
7
|
+
data.tar.gz: 51420c695bc3bf1db62dc8bcbd3ffb0264d1371bbe50d3dea95159f632ecec4b51a861b380ec1eb332a619af576a72a12b2d3291ea259a75548c8fc26359d356
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/lib/healthcare_phony.rb
CHANGED
@@ -11,20 +11,24 @@ Faker::Config.locale = 'en-US'
|
|
11
11
|
|
12
12
|
module HealthcarePhony
|
13
13
|
class Adt
|
14
|
-
attr_reader :
|
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
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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(
|
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
|
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.
|
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-
|
11
|
+
date: 2021-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|