ruby-hl7-extensions 0.0.68 → 0.0.69

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80780b36f304c818e8e2572103486dcbb4e5af7a
4
- data.tar.gz: 61ffaac9fb6ff87b72050a39525366eaa2281de7
3
+ metadata.gz: 1f9eb8d50470a56286cc1931ad4890230d857fa6
4
+ data.tar.gz: d2d85f72950527780a68292d34ca64f21c7b4cf1
5
5
  SHA512:
6
- metadata.gz: 1ed0012cdc06979f9c7a663b1793efa195a8ddde23e6149899eaa350318aba3406f7b9fe27f1434c246a79a036701df6373bb467438276800ee06a8ff48066d5
7
- data.tar.gz: 416453d172242c98fbfc4cd2c40a10b88875137f10ac6a1dd6d8c7acb4c4af912566b58b78c095605abd02910b4b1801388d76987fd8c0a7f5283e18f1bf6acc
6
+ metadata.gz: 472f6e8f81271f548abde8e69dadd89f16e53c4cc3f22b0a69e5584e2a68da2597134a3f2aaf5a205887853e673678c7616d449c2b9e8caad1cd4f212f94598a
7
+ data.tar.gz: 5e2fab80b71f0e86c77f262b894eacd6975123df8f7df0a3440594c95a8a4273f2c334a1228346392b1a06fa73d50ce250ba9419f838bd4f55506f658dea0467
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.68
1
+ 0.0.69
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 0
4
- :patch: 68
4
+ :patch: 69
@@ -89,11 +89,32 @@ module Extensions
89
89
  instance
90
90
  end
91
91
 
92
+ def description
93
+ ""
94
+ end
95
+
96
+ def field_description(field_index)
97
+ ""
98
+ end
99
+
100
+ def is_required?
101
+ false
102
+ end
103
+
104
+ def index_for(field_name)
105
+ index = self.fields.collect {|field| field[0]}.index(field_name) rescue -1
106
+ if index < 0
107
+ return -1
108
+ else
109
+ return index + 1
110
+ end
111
+ end
112
+
92
113
  def mappings
93
114
  field_mappings = self.fields.inject([]) {|arr, k| arr << {field_name: k[0].to_s.gsub("_", " ").titleize, type: "String", field_code: k[1][:idx]}; arr}
94
115
 
95
116
  {
96
- metadata: {segment_code: self.to_s.downcase, display_name: ""},
117
+ metadata: {segment_code: self.to_s.split("::").last, display_name: ""},
97
118
  fields: field_mappings
98
119
  }
99
120
  end
@@ -0,0 +1,33 @@
1
+ module Extensions
2
+ module HL7
3
+ module Segments
4
+ module ERR
5
+
6
+ def self.included base
7
+ base.send :include, InstanceMethods
8
+ base.extend ClassMethods
9
+ end
10
+
11
+ module InstanceMethods
12
+ def to_hash
13
+ @hash = {}
14
+ end
15
+ end
16
+
17
+ module ClassMethods
18
+ def index_for(field_name)
19
+ return 12 if field_name == :help_desk_contact_point
20
+
21
+ index = self.fields.collect {|field| field[0]}.index(field_name) rescue -1
22
+ if index < 0
23
+ return -1
24
+ else
25
+ return index
26
+ end
27
+ end
28
+ end
29
+
30
+ end
31
+ end
32
+ end
33
+ end
@@ -15,6 +15,21 @@ module Extensions
15
15
  end
16
16
 
17
17
  module ClassMethods
18
+ def description
19
+ "Event Type"
20
+ end
21
+
22
+ def field_description(field_index)
23
+ [
24
+ "Event Type Code",
25
+ "Recorded Date/Time",
26
+ "Date/Time Planned Event",
27
+ "Event Reason Code",
28
+ "Operator Id",
29
+ "Event Occurred",
30
+ "Event Facility"
31
+ ][field_index-1]
32
+ end
18
33
  end
19
34
 
20
35
  end
@@ -9,6 +9,7 @@ module Extensions
9
9
  end
10
10
 
11
11
  module InstanceMethods
12
+
12
13
  def to_hash
13
14
  return @hash if @hash
14
15
 
@@ -75,6 +76,40 @@ module Extensions
75
76
  end
76
77
 
77
78
  module ClassMethods
79
+ def is_required?
80
+ true
81
+ end
82
+
83
+ def description
84
+ "Message Header"
85
+ end
86
+
87
+ def field_description(field_index)
88
+ ["Encoding Characters",
89
+ "Sending Application",
90
+ "Sending Facility",
91
+ "Receiving Application",
92
+ "Receiving Facility",
93
+ "Date/Time Of Message",
94
+ "Security",
95
+ "Message Type",
96
+ "Message Control Id",
97
+ "Processing Id",
98
+ "Version Id",
99
+ "Sequence Number",
100
+ "Continuation Pointer",
101
+ "Accept Acknowledgment Type",
102
+ "Application Acknowledgment Type",
103
+ "Country Code",
104
+ "Character Set",
105
+ "Principal Language Of Message",
106
+ "Alternate Character Set Handling Scheme",
107
+ "Message Profile Identifier",
108
+ "Sending Responsible Organization",
109
+ "Receiving Responsible Organization",
110
+ "Sending Network Address",
111
+ "Receiving Network Address"][field_index-1]
112
+ end
78
113
  end
79
114
 
80
115
  end
@@ -15,6 +15,19 @@ module Extensions
15
15
  end
16
16
 
17
17
  module ClassMethods
18
+ def index_for(field_name)
19
+ return 1 if field_name == :set_id
20
+ return 2 if field_name == :name
21
+ return 3 if field_name == :relationship
22
+ return 4 if field_name == :address
23
+ return 5 if field_name == :phone_number
24
+ return 13 if field_name == :organization_name
25
+ return 20 if field_name == :primary_language
26
+ return 30 if field_name == :contact_persons_name
27
+ return 31 if field_name == :contact_persons_telephone_number
28
+ return 32 if field_name == :contact_persons_address
29
+ return -1
30
+ end
18
31
  end
19
32
 
20
33
  end
@@ -9,6 +9,7 @@ module Extensions
9
9
  end
10
10
 
11
11
  module InstanceMethods
12
+
12
13
  def patient_full_name
13
14
  last_name = self.value_for_field("5.1")
14
15
  first_name = self.value_for_field("5.2")
@@ -59,6 +60,59 @@ module Extensions
59
60
  end
60
61
 
61
62
  module ClassMethods
63
+ def is_required?
64
+ true
65
+ end
66
+
67
+ def description
68
+ "Patient Identification"
69
+ end
70
+
71
+ def field_description(field_index)
72
+ [
73
+ "Set Id - Pid",
74
+ "Patient Id",
75
+ "Patient Identifier List",
76
+ "Alternate Patient Id - Pid",
77
+ "Patient Name",
78
+ "Mother's Maiden Name",
79
+ "Date/Time Of Birth",
80
+ "Administrative Sex",
81
+ "Patient Alias",
82
+ "Race",
83
+ "Patient Address",
84
+ "County Code",
85
+ "Phone Number - Home",
86
+ "Phone Number - Business",
87
+ "Primary Language",
88
+ "Marital Status",
89
+ "Religion",
90
+ "Patient Account Number",
91
+ "Ssn Number - Patient",
92
+ "Driver's License Number - Patient",
93
+ "Mother's Identifier",
94
+ "Ethnic Group",
95
+ "Birth Place",
96
+ "Multiple Birth Indicator",
97
+ "Birth Order",
98
+ "Citizenship",
99
+ "Veterans Military Status",
100
+ "Nationality",
101
+ "Patient Death Date And Time",
102
+ "Patient Death Indicator",
103
+ "Identity Unknown Indicator",
104
+ "Identity Reliability Code",
105
+ "Last Update Date/Time",
106
+ "Last Update Facility",
107
+ "Species Code",
108
+ "Breed Code",
109
+ "Strain",
110
+ "Production Class Code",
111
+ "Tribal Citizenship",
112
+ "Patient Telecommunication Information"
113
+ ][field_index-1]
114
+ end
115
+
62
116
  end
63
117
 
64
118
  end
@@ -134,17 +134,69 @@ module Extensions
134
134
  end
135
135
 
136
136
  module ClassMethods
137
- # def mappings
138
- # {metadata: {segment_code: "pv1", display_name: "Patient Visit"},
139
- # fields: [{field_name: "Patient Class", type: "String", field_code: "2"},
140
- # {field_name: "Point of Care", type: "String", field_code: "3.1"},
141
- # {field_name: "Facility", type: "String", field_code: "3.4"},
142
- # {field_name: "Floor", type: "String", field_code: "3.8"},
143
- # {field_name: "Admission Type", type: "String", field_code: "4"},
144
- # {field_name: "Preadmit Number ID", type: "String", field_code: "5.1"},
145
- # {field_name: "Visit Number ID", type: "String", field_code: "19.1"}]
146
- # }
147
- # end
137
+ def description
138
+ "Patient Visit"
139
+ end
140
+
141
+ def field_description(field_index)
142
+ [
143
+ "Set Id - Pv1",
144
+ "Patient Class",
145
+ "Assigned Patient Location",
146
+ "Admission Type",
147
+ "Preadmit Number",
148
+ "Prior Patient Location",
149
+ "Attending Doctor",
150
+ "Referring Doctor",
151
+ "Consulting Doctor",
152
+ "Hospital Service",
153
+ "Temporary Location",
154
+ "Preadmit Test Indicator",
155
+ "Re-admission Indicator",
156
+ "Admit Source",
157
+ "Ambulatory Status",
158
+ "Vip Indicator",
159
+ "Admitting Doctor",
160
+ "Patient Type",
161
+ "Visit Number",
162
+ "Financial Class",
163
+ "Charge Price Indicator",
164
+ "Courtesy Code",
165
+ "Credit Rating",
166
+ "Contract Code",
167
+ "Contract Effective Date",
168
+ "Contract Amount",
169
+ "Contract Period",
170
+ "Interest Code",
171
+ "Transfer To Bad Debt Code",
172
+ "Transfer To Bad Debt Date",
173
+ "Bad Debt Agency Code",
174
+ "Bad Debt Transfer Amount",
175
+ "Bad Debt Recovery Amount",
176
+ "Delete Account Indicator",
177
+ "Delete Account Date",
178
+ "Discharge Disposition",
179
+ "Discharged To Location",
180
+ "Diet Type",
181
+ "Servicing Facility",
182
+ "Bed Status",
183
+ "Account Status",
184
+ "Pending Location",
185
+ "Prior Temporary Location",
186
+ "Admit Date/Time",
187
+ "Discharge Date/Time",
188
+ "Current Patient Balance",
189
+ "Total Charges",
190
+ "Total Adjustments",
191
+ "Total Payments",
192
+ "Alternate Visit Id",
193
+ "Visit Indicator",
194
+ "Other Healthcare Provider",
195
+ "Service Episode Description",
196
+ "Service Episode Identifier",
197
+ ][field_index-1]
198
+ end
199
+
148
200
  end
149
201
 
150
202
  end
@@ -7,8 +7,10 @@ require 'core_ext/segments/nte'
7
7
  require 'core_ext/segments/nk1'
8
8
  require 'core_ext/segments/pv1'
9
9
  require 'core_ext/segments/evn'
10
+ require 'core_ext/segments/sft'
11
+ require 'core_ext/segments/err'
10
12
 
11
- segments = ["MSH","PID","ORC","OBR","OBX","NTE","NK1", "PV1", "EVN"]
13
+ segments = ["MSH","PID","ORC","OBR","OBX","NTE","NK1", "PV1", "EVN", "SFT", "ERR"]
12
14
  segments.each do |segment_name|
13
15
 
14
16
  eval("class HL7::Message::Segment::#{segment_name} < HL7::Message::Segment
@@ -0,0 +1,31 @@
1
+ module Extensions
2
+ module HL7
3
+ module Segments
4
+ module SFT
5
+
6
+ def self.included base
7
+ base.send :include, InstanceMethods
8
+ base.extend ClassMethods
9
+ end
10
+
11
+ module InstanceMethods
12
+ def to_hash
13
+ @hash = {}
14
+ end
15
+ end
16
+
17
+ module ClassMethods
18
+ def index_for(field_name)
19
+ index = self.fields.collect {|field| field[0]}.index(field_name) rescue -1
20
+ if index < 0
21
+ return -1
22
+ else
23
+ return index
24
+ end
25
+ end
26
+ end
27
+
28
+ end
29
+ end
30
+ end
31
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ruby-hl7-extensions"
6
- s.version = "0.0.68"
6
+ s.version = "0.0.69"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.email = "ruby-hl7-json@googlegroups.com"
14
14
  s.extra_rdoc_files = ["LICENSE", "README.md"]
15
15
  s.files = [".gitignore", "Gemfile", "Gemfile.lock", "LICENSE", "README.md", "Rakefile", "VERSION", "VERSION.yml", "lib/core_ext/segments/rol.rb",
16
- "lib/core_ext/message.rb", "lib/core_ext/segment.rb",
16
+ "lib/core_ext/message.rb", "lib/core_ext/segment.rb", "lib/core_ext/segments/err.rb", "lib/core_ext/segments/sft.rb",
17
17
  "lib/core_ext/segments/msh.rb", "lib/core_ext/segments/nk1.rb", "lib/core_ext/segments/orc.rb", "lib/core_ext/segments/evn.rb", "lib/core_ext/segments/nte.rb", "lib/core_ext/segments/obr.rb", "lib/core_ext/segments/obx.rb", "lib/core_ext/segments/pid.rb", "lib/core_ext/segments/pv1.rb", "lib/core_ext/segments/segments.rb",
18
18
  "lib/ruby-hl7-extensions.rb", "ruby-hl7-extensions.gemspec"]
19
19
  s.homepage = "http://github.com/nmlynl/ruby-hl7-extensions"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-hl7-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.68
4
+ version: 0.0.69
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Lega
@@ -56,6 +56,7 @@ files:
56
56
  - VERSION.yml
57
57
  - lib/core_ext/message.rb
58
58
  - lib/core_ext/segment.rb
59
+ - lib/core_ext/segments/err.rb
59
60
  - lib/core_ext/segments/evn.rb
60
61
  - lib/core_ext/segments/msh.rb
61
62
  - lib/core_ext/segments/nk1.rb
@@ -67,6 +68,7 @@ files:
67
68
  - lib/core_ext/segments/pv1.rb
68
69
  - lib/core_ext/segments/rol.rb
69
70
  - lib/core_ext/segments/segments.rb
71
+ - lib/core_ext/segments/sft.rb
70
72
  - lib/ruby-hl7-extensions.rb
71
73
  - ruby-hl7-extensions.gemspec
72
74
  homepage: http://github.com/nmlynl/ruby-hl7-extensions