ez7gen 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/ez7gen +6 -0
- data/lib/ez7gen.rb +23 -0
- data/lib/ez7gen/config/schema/2.4/2.4.HL7.xml +13904 -0
- data/lib/ez7gen/config/schema/2.4/VAZ2.4.HL7.xml +3085 -0
- data/lib/ez7gen/config/schema/2.4/added/coded-tables.xml +730 -0
- data/lib/ez7gen/config/schema/2.4/rules/2.4.HL7.yml +4 -0
- data/lib/ez7gen/config/schema/2.4/rules/VAZ2.4.HL7.yml +6 -0
- data/lib/ez7gen/config/schema/2.5/2.5.HL7.xml +10008 -0
- data/lib/ez7gen/config/schema/2.5/VAZ2.5.HL7.xml +7 -0
- data/lib/ez7gen/config/schema/2.5/added/coded-tables.xml +549 -0
- data/lib/ez7gen/config/schema/readme.txt +0 -0
- data/lib/ez7gen/config/templates/2.4/eiv table update-mfn_m01 20151201.xml +416 -0
- data/lib/ez7gen/config/templates/2.4/eiv table update-mfn_y01.xml +416 -0
- data/lib/ez7gen/config/templates/2.4/eiv-ec-MFN_X01_reg request 20160126.xml +659 -0
- data/lib/ez7gen/config/templates/2.4/examples/ADT_A60.txt +69 -0
- data/lib/ez7gen/config/templates/2.4/examples/eiv table update-mfn_m01 20151201.txt +21 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_dss_units-query_qbp_q13-qbp_q13.txt +26 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_ecs_procedures_query_qbp_q13-qbp_q13.txt +26 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_patient eligibility_response-rsp_k11-080714.txt +44 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_standardhl7lib_diagnosis_query_qbp_q11-qbp_q11.txt +21 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_standardhl7lib_diagnosis_response_rsp_k11-rsp_k11.txt +42 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_standardhl7lib_dss_units_response_rtb_k13-rtb_k13.txt +49 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_standardhl7lib_ecs_filer_request_dft_p03-dft_p03-080714.txt +31 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_standardhl7lib_ecs_filer_response_ack_p03-ack_p03.txt +21 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_standardhl7lib_esc_procedures_response_rtb_k13-rtb_k13.txt +40 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_standardhl7lib_patient_eclass_query_qbp_q11-qbp_q11.txt +21 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_standardhl7lib_patient_problems_query_qbp_q11-qbp_q11.txt +21 -0
- data/lib/ez7gen/config/templates/2.4/examples/mhvsm_standardhl7lib_patinet_problems_response_rsp_k11-rsp_k11.txt +33 -0
- data/lib/ez7gen/config/templates/2.4/examples/orur01rvbecv2.txt +31 -0
- data/lib/ez7gen/config/templates/2.4/examples/sqwm vitals-oru_ro1.txt +52 -0
- data/lib/ez7gen/config/templates/2.4/examples/vista sqwm-adt_a60.txt +40 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_dss_units_query_qbp_q13-qbp_q13.xml +312 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_ecs_procedures_query_qbp_q13-qbp_q13.xml +314 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_patient eligibility_response-rsp_k11-080714.xml +640 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_standardhl7lib_diagnosis_query_qbp_q11-qbp_q11.xml +284 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_standardhl7lib_diagnosis_response_rsp_k11-rsp_k11-rsp_k11.xml +563 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_standardhl7lib_dss_units_response_rtb_k13-rtb_k13-rtb_k13.xml +365 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_standardhl7lib_ecs_filer_request_dft_p03-dft_p03-080714.xml +2172 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_standardhl7lib_ecs_filer_response_ack_p03-ack_p03.xml +269 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_standardhl7lib_ecs_procedures_response_rtb_k13-rtb_k13-rtb_k13.xml +354 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_standardhl7lib_patient_eclass_query_qbp_q11-qbp_q11.xml +284 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_standardhl7lib_patient_problems_query_qbp_q11-qbp_q11.xml +282 -0
- data/lib/ez7gen/config/templates/2.4/mhvsm_standardhl7lib_patient_problems_response_rsp_k11-rsp_k11-rsp_k11.xml +565 -0
- data/lib/ez7gen/config/templates/2.4/orur01rvbecv2.xml +1529 -0
- data/lib/ez7gen/config/templates/2.4/sqwm vitals-oru_r01.xml +2975 -0
- data/lib/ez7gen/config/templates/2.4/vista sqwm-adt_a60.xml +1360 -0
- data/lib/ez7gen/message_factory.rb +142 -0
- data/lib/ez7gen/msg_error_handler.rb +33 -0
- data/lib/ez7gen/profile_parser.rb +321 -0
- data/lib/ez7gen/resources/properties-with-comments.yml +51 -0
- data/lib/ez7gen/resources/properties.yml +325 -0
- data/lib/ez7gen/service/2.4/dynamic_field_generator.rb +45 -0
- data/lib/ez7gen/service/2.4/field_generator.rb +1586 -0
- data/lib/ez7gen/service/2.5/field_generator.rb +75 -0
- data/lib/ez7gen/service/base_field_generator.rb +451 -0
- data/lib/ez7gen/service/segment_generator.rb +218 -0
- data/lib/ez7gen/service/segment_picker.rb +147 -0
- data/lib/ez7gen/service/template_generator.rb +213 -0
- data/lib/ez7gen/service/type_aware_field_generator.rb +1583 -0
- data/lib/ez7gen/service/utils.rb +75 -0
- data/lib/ez7gen/structure_parser.rb +331 -0
- data/lib/ez7gen/version.rb +38 -0
- data/test/Additional Tables with values_v1.1.txt +1653 -0
- data/test/added_shema_test.rb +143 -0
- data/test/app-tmp.rb +225 -0
- data/test/at.txt +1 -0
- data/test/backburner.zip +0 -0
- data/test/codes.txt +262 -0
- data/test/codes1.txt +1240 -0
- data/test/data_types_exploration_test.rb +213 -0
- data/test/dynamic_field_generated_test.rb +292 -0
- data/test/message_factory_24_custom_test.rb +648 -0
- data/test/message_factory_25_test.rb +50 -0
- data/test/message_factory_adm_test.rb +558 -0
- data/test/message_factory_gen_test.rb +63 -0
- data/test/message_factory_lab_test.rb +107 -0
- data/test/message_factory_pharm_test.rb +121 -0
- data/test/message_factory_template_24_test.rb +730 -0
- data/test/message_factory_test.rb +220 -0
- data/test/msg_error_handler_test.rb +59 -0
- data/test/profile_parser_test.rb +542 -0
- data/test/quick_run.rb +880 -0
- data/test/segment_generator_test.rb +656 -0
- data/test/segment_picker_test.rb +279 -0
- data/test/structrure_parser_test.rb +355 -0
- data/test/template_generator_test.rb +164 -0
- data/test/type_aware_field_generator_test.rb +582 -0
- data/test/utils_test.rb +97 -0
- metadata +215 -0
@@ -0,0 +1,143 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'ox'
|
3
|
+
|
4
|
+
class Sample
|
5
|
+
attr_accessor :a, :b, :c
|
6
|
+
|
7
|
+
def initialize(a, b, c)
|
8
|
+
@a = a
|
9
|
+
@b = b
|
10
|
+
@c = c
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class AddedShemaTest < Test::Unit::TestCase
|
15
|
+
|
16
|
+
# Called after every test method runs. Can be used to tear
|
17
|
+
# down fixture information.
|
18
|
+
|
19
|
+
def teardown
|
20
|
+
# Do nothing
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_xml
|
24
|
+
|
25
|
+
# Create Object
|
26
|
+
obj = Sample.new(1, "bee", ['x', :y, 7.0])
|
27
|
+
# Now dump the Object to an XML String.
|
28
|
+
xml = Ox.dump(obj,nil)
|
29
|
+
puts xml
|
30
|
+
|
31
|
+
# Convert the object back into a Sample Object.
|
32
|
+
obj2 = Ox.parse_obj(xml)
|
33
|
+
# Called before every test method runs. Can be used
|
34
|
+
# to set up fixture information.
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_build_added_tables_xml
|
38
|
+
# file = File.expand_path('codes.txt', __FILE__).to_s
|
39
|
+
arr = []
|
40
|
+
|
41
|
+
File.readlines('Additional Tables with values_v1.1.txt').map do |line|
|
42
|
+
# File.readlines('codes1.txt').map do |line|
|
43
|
+
arr<<line.chomp
|
44
|
+
# puts line
|
45
|
+
end
|
46
|
+
z = []
|
47
|
+
arr.each_with_index{|val, idx| if(idx % 2 == 0)then z<< [arr[idx], arr[idx+1] ] end}
|
48
|
+
p z
|
49
|
+
x =[]
|
50
|
+
row = []
|
51
|
+
idx = 0
|
52
|
+
z.each{|pair|
|
53
|
+
# if(pair[0].strip.empty?)
|
54
|
+
if(pair[0].gsub(/[[:space:]]/,'').empty?)
|
55
|
+
x << row
|
56
|
+
idx= idx + 1
|
57
|
+
row = []
|
58
|
+
else
|
59
|
+
row << pair
|
60
|
+
end
|
61
|
+
}
|
62
|
+
p x
|
63
|
+
|
64
|
+
root = Ox::Element.new('Export')
|
65
|
+
doc = Ox::Element.new('Document')
|
66
|
+
doc[:name]='Codes for coded tables with missing entries'
|
67
|
+
root << doc
|
68
|
+
cat = Ox::Element.new('Category')
|
69
|
+
cat[:name] = '2.4'
|
70
|
+
doc << cat
|
71
|
+
|
72
|
+
x.each{|it|
|
73
|
+
|
74
|
+
codeTbl = Ox::Element.new('CodeTable')
|
75
|
+
|
76
|
+
codeTbl[:name] = it.first[0].delete('Table ')
|
77
|
+
# drop 2 first elements: table name and fields [Code, Description]
|
78
|
+
it.drop(2).each_with_index { |pair,i |
|
79
|
+
enum = Ox::Element.new('Enumerate')
|
80
|
+
enum[:position] = i + 1
|
81
|
+
enum[:value] = pair.first
|
82
|
+
enum[:description] = pair.last
|
83
|
+
codeTbl << enum
|
84
|
+
}
|
85
|
+
cat << codeTbl
|
86
|
+
}
|
87
|
+
|
88
|
+
|
89
|
+
xml = Ox.dump(root, nil)
|
90
|
+
puts xml
|
91
|
+
|
92
|
+
|
93
|
+
# doc << top
|
94
|
+
#
|
95
|
+
# ce = [['E','Employer'], ['G','Guarantor']]
|
96
|
+
# ce.each_with_index{|value, index|
|
97
|
+
# mid = Ox::Element.new('Enumarate')
|
98
|
+
# mid[:position] = index
|
99
|
+
# mid[:value] = value[0]
|
100
|
+
# mid[:description] = value[1]
|
101
|
+
# top << mid
|
102
|
+
# }
|
103
|
+
|
104
|
+
|
105
|
+
# doc = Ox::Document.new(:version => '1.0')
|
106
|
+
#
|
107
|
+
# arr = [00,'Surgical']
|
108
|
+
# arr<<[10, 'Medical']
|
109
|
+
# arr<<[60, 'Home Nursing Service']
|
110
|
+
# arr<<[85,'Psychiatric Contract']
|
111
|
+
# arr<<[86, 'Psychiatric']
|
112
|
+
# arr<<[95, 'Neurological Contract']
|
113
|
+
# arr<<[96, 'Neurological']
|
114
|
+
#
|
115
|
+
#
|
116
|
+
#
|
117
|
+
# top = Ox::Element.new('CodeTable')
|
118
|
+
# top[:name] = '137'
|
119
|
+
# doc << top
|
120
|
+
#
|
121
|
+
# ce = [['E','Employer'], ['G','Guarantor']]
|
122
|
+
# ce.each_with_index{|value, index|
|
123
|
+
# mid = Ox::Element.new('Enumarate')
|
124
|
+
# mid[:position] = index
|
125
|
+
# mid[:value] = value[0]
|
126
|
+
# mid[:description] = value[1]
|
127
|
+
# top << mid
|
128
|
+
# }
|
129
|
+
#
|
130
|
+
# # bot = Ox::Element.new('bottom')
|
131
|
+
# # bot[:name] = 'third'
|
132
|
+
# # mid << bot
|
133
|
+
#
|
134
|
+
# xml = Ox.dump(doc, nil)
|
135
|
+
# puts xml
|
136
|
+
|
137
|
+
end
|
138
|
+
|
139
|
+
def setup
|
140
|
+
# Do nothing
|
141
|
+
end
|
142
|
+
|
143
|
+
end
|
data/test/app-tmp.rb
ADDED
@@ -0,0 +1,225 @@
|
|
1
|
+
|
2
|
+
# require 'sinatra'
|
3
|
+
require 'sinatra/base'
|
4
|
+
|
5
|
+
require 'json'
|
6
|
+
require 'rest_client'
|
7
|
+
#require 'diskcached'
|
8
|
+
require 'ez7gen'
|
9
|
+
# require_relative '../lib/ez7gen/message_factory' # local testing
|
10
|
+
# require_relative '../lib/ez7gen/profile_parser' # local testing
|
11
|
+
# require_relative '../lib/ez7gen/msg_error_handler' # local testing
|
12
|
+
|
13
|
+
class MyApp < Sinatra::Application
|
14
|
+
|
15
|
+
# configure do
|
16
|
+
# set :show_exceptions, :after_handler
|
17
|
+
# disable :raise_errors
|
18
|
+
# end
|
19
|
+
@@URLS={'2.4'=>'localhost:9980/','VAZ2.4'=>'localhost:9981/'}
|
20
|
+
# admisson messages match pattern
|
21
|
+
@@FILTERS = [ProfileParser::FILTER_ADM, ProfileParser::FILTER_FM, ProfileParser::FILTER_GEN, ProfileParser::FILTER_LAB, ProfileParser::FILTER_MSR, ProfileParser::FILTER_OBS, ProfileParser::FILTER_PH]
|
22
|
+
|
23
|
+
#configure do
|
24
|
+
# $diskcache = Diskcached.new(File.join(settings.root, 'cache'))
|
25
|
+
# $diskcache.flush # ensure caches are empty on startup
|
26
|
+
# cahe version store
|
27
|
+
# MyApp.class.cache_lookup('version_store')
|
28
|
+
# puts 'in configure'
|
29
|
+
#end
|
30
|
+
|
31
|
+
#
|
32
|
+
# before do
|
33
|
+
# @cache_key = cache_sha(request.path_info)
|
34
|
+
# end
|
35
|
+
|
36
|
+
get '/' do
|
37
|
+
# content_type :json
|
38
|
+
# redirect 'js/app.js'
|
39
|
+
redirect 'views/index.html'
|
40
|
+
end
|
41
|
+
|
42
|
+
get '/version/' do
|
43
|
+
content_type :json
|
44
|
+
{ version: Ez7gen::VERSION}.to_json
|
45
|
+
end
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
get '/pulse' do
|
50
|
+
# vs = cache_lookup('version_store')
|
51
|
+
end
|
52
|
+
|
53
|
+
post '/generate/' do
|
54
|
+
begin
|
55
|
+
# no additional configuration needed for angularjs,
|
56
|
+
params = JSON.parse(request.env["rack.input"].read)
|
57
|
+
puts params
|
58
|
+
|
59
|
+
std = params['std']
|
60
|
+
event = params['event']['name']
|
61
|
+
version = params['version']['name']
|
62
|
+
puts "std: #{std}, event: #{event}, version: #{version}"
|
63
|
+
useExVal = params['useExVal']
|
64
|
+
useTemplate = params['useTemplate']
|
65
|
+
|
66
|
+
vs = ProfileParser.lookup_versions()
|
67
|
+
@resp = MessageFactory.new({std: std, version: version, event:event, version_store: vs, use_template: useTemplate}).generate(useExVal) #msg.replace('\r','\n' )
|
68
|
+
|
69
|
+
rescue => e
|
70
|
+
# puts 'inside rescue'
|
71
|
+
puts 'Error: processing generate/' << e.inspect
|
72
|
+
@resp ='Oops, somenthing went wrong...'
|
73
|
+
# raise e
|
74
|
+
# ensure
|
75
|
+
end
|
76
|
+
#send response
|
77
|
+
{message: @resp}.to_json
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
post '/validate/' do
|
82
|
+
begin
|
83
|
+
params = JSON.parse(request.env["rack.input"].read)
|
84
|
+
puts params
|
85
|
+
version = params['version']['code']
|
86
|
+
puts version
|
87
|
+
payload = params['hl7']['message']
|
88
|
+
puts payload
|
89
|
+
puts "------------ validate ---------------"
|
90
|
+
@url = @@URLS[version]
|
91
|
+
@resp = RestClient.post @url, payload.gsub!("\n","\r")
|
92
|
+
#@resp = @resp.gsub("\r\n", "\n").gsub("\r", "\n")
|
93
|
+
#puts @resp.gsub!("\X0D\\X0A", "\n")
|
94
|
+
puts @resp.gsub!("\\X0D\\\\X0A\\", "\r")
|
95
|
+
puts @resp.gsub!("\r+\r", "\r")
|
96
|
+
#@resp.gsub!("\r","\n")
|
97
|
+
puts ' len: ' + @resp.size().to_s
|
98
|
+
puts "------------ response ---------------"
|
99
|
+
r = @resp.chomp()
|
100
|
+
#r = @resp
|
101
|
+
puts r
|
102
|
+
puts 'len:' + r.size().to_s
|
103
|
+
puts "------------ response 1 ---------------"
|
104
|
+
#@errors = MsgErrorHandler.new().handle(r)
|
105
|
+
# segs = message
|
106
|
+
|
107
|
+
segs = r.split("\n")
|
108
|
+
puts "--------------------segments----------------"
|
109
|
+
segs.each {|it| puts it; puts "~~~~~~~~~~~~~"}
|
110
|
+
puts "--------------------segments----------------"
|
111
|
+
|
112
|
+
msg = HL7::Message.new(r)
|
113
|
+
# msg = HL7::Message.parse(message)
|
114
|
+
seg = msg[:ERR]
|
115
|
+
if(! msg[:ERR])
|
116
|
+
return nil
|
117
|
+
end
|
118
|
+
|
119
|
+
# puts msg[:ERR].error_location
|
120
|
+
# puts msg[:ERR].hl7_error_code
|
121
|
+
puts msg[:ERR].severity
|
122
|
+
puts msg[:ERR].application_error_code
|
123
|
+
# puts msg[:ERR].application_error_parameter
|
124
|
+
# puts msg[:ERR].diagnostic_information
|
125
|
+
errors = msg[:ERR].user_message
|
126
|
+
puts errors
|
127
|
+
puts "------------ user message ---------------"
|
128
|
+
|
129
|
+
# puts msg[:ERR].help_desk_contact_point
|
130
|
+
lines = r.split("ERROR <Ens>ErrGeneral:")
|
131
|
+
puts lines
|
132
|
+
puts "------------ lines ---------------"
|
133
|
+
|
134
|
+
@errors = r.split("ERROR <Ens>ErrGeneral:").reject {|e| e.empty?}
|
135
|
+
@errors.delete_at(0)
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
puts @errors
|
140
|
+
puts "------------ errors ---------------"
|
141
|
+
|
142
|
+
rescue => e
|
143
|
+
@resp = 'Error connecting to ' + @url
|
144
|
+
puts e
|
145
|
+
# raise e
|
146
|
+
end
|
147
|
+
|
148
|
+
# send response
|
149
|
+
{message: @resp.gsub("\r","\n"), errors: @errors}.to_json
|
150
|
+
end
|
151
|
+
|
152
|
+
# https://code.google.com/p/x2js/ as an alternative
|
153
|
+
get '/lookup/' do
|
154
|
+
versions_to_client = {}
|
155
|
+
|
156
|
+
begin
|
157
|
+
versions = ProfileParser.lookup_versions()
|
158
|
+
#puts cache_lookup('hW')
|
159
|
+
|
160
|
+
std_arr =[]
|
161
|
+
versions.each{ |version|
|
162
|
+
std_attrs={}
|
163
|
+
# standard
|
164
|
+
std_attrs[:std] = version[:std]
|
165
|
+
#versions
|
166
|
+
std_attrs[:versions] = version[:profiles].inject([]){|col,p| col << {name: p[:doc], code: p[:name], desc: (p[:std])? 'Base': p[:description]}}
|
167
|
+
#events
|
168
|
+
evn_attrs = version[:profiles].inject({}){|h,p|
|
169
|
+
h.merge({p[:name] => ProfileParser.new({std: version[:std], version: p[:doc], version_store: versions}).lookup_message_groups(@@FILTERS)})
|
170
|
+
}
|
171
|
+
std_attrs[:events] = evn_attrs
|
172
|
+
# add map with versions and events for each standard to the array
|
173
|
+
std_arr << std_attrs
|
174
|
+
}
|
175
|
+
|
176
|
+
versions_to_client = {standards: std_arr}
|
177
|
+
# pth = File.join(File.dirname(__FILE__), "v_items_mock.json")
|
178
|
+
# txt = File.read(pth)
|
179
|
+
# versions_to_client = JSON.parse(txt)
|
180
|
+
# versions_to_client.to_json
|
181
|
+
|
182
|
+
# p event_list
|
183
|
+
p 'in lookup'
|
184
|
+
rescue => e
|
185
|
+
puts e
|
186
|
+
end
|
187
|
+
versions_to_client.to_json
|
188
|
+
# items = {standards:[
|
189
|
+
# {std:'2.4',
|
190
|
+
# versions:[{'name'=> '2.4', 'code'=> '2.4', 'desc'=>'Base'},{'name' =>'VAZ 2.4', 'code'=> 'vaz2.4', 'desc'=>'2.4 schema with VA defined tables and Z segments'}],
|
191
|
+
# events: {'2.4' => event_list['2.4'], 'vaz2.4' => event_list['vaz2.4']}
|
192
|
+
# },
|
193
|
+
# {std:'2.5', versions:[], events:[]}
|
194
|
+
# ]}
|
195
|
+
# items.to_json
|
196
|
+
|
197
|
+
end
|
198
|
+
|
199
|
+
# error do
|
200
|
+
# puts 'inside error'
|
201
|
+
# # 'Sorry there was a nasty error - ' + env['sinatra.error'].message
|
202
|
+
# end
|
203
|
+
|
204
|
+
#def cache_lookup(key)
|
205
|
+
# begin
|
206
|
+
# value = $diskcache.get(key)
|
207
|
+
# rescue Diskcached::NotFound => e # prevents easy replacement, but is safer.
|
208
|
+
# case key
|
209
|
+
# when 'version_store'
|
210
|
+
# value = ProfileParser.lookup_versions()
|
211
|
+
# else
|
212
|
+
# value = 'Hello World'
|
213
|
+
# end
|
214
|
+
# if(value) then $diskcache.set(key, value) end
|
215
|
+
# end
|
216
|
+
# return value
|
217
|
+
#end
|
218
|
+
|
219
|
+
|
220
|
+
# $0 is the executed file
|
221
|
+
# __FILE__ is the current file
|
222
|
+
run! if __FILE__ == $0
|
223
|
+
end
|
224
|
+
# HELPER METHODS
|
225
|
+
# cache lookup method
|
data/test/at.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Table 10 Physician ID
|
data/test/backburner.zip
ADDED
Binary file
|
data/test/codes.txt
ADDED
@@ -0,0 +1,262 @@
|
|
1
|
+
Table 18
|
2
|
+
Patient Type
|
3
|
+
Code
|
4
|
+
Description
|
5
|
+
00
|
6
|
+
Surgical
|
7
|
+
10
|
8
|
+
Medical
|
9
|
+
60
|
10
|
+
Home Nursing Service
|
11
|
+
85
|
12
|
+
Psychiatric Contract
|
13
|
+
86
|
14
|
+
Psychiatric
|
15
|
+
95
|
16
|
+
Neurological Contract
|
17
|
+
96
|
18
|
+
Neurological
|
19
|
+
|
20
|
+
|
21
|
+
Table 51
|
22
|
+
Diagnosis Code
|
23
|
+
Code
|
24
|
+
Description
|
25
|
+
E23.0
|
26
|
+
Panhypopituitarism
|
27
|
+
E23.6
|
28
|
+
Other disorders of pituitary gland
|
29
|
+
E23.2
|
30
|
+
Diabetes insipidus
|
31
|
+
E23.3
|
32
|
+
Hypothalamic dysfunction, not elsewhere classified
|
33
|
+
E23.1
|
34
|
+
Drug-induced hypopituitarism
|
35
|
+
E32.8
|
36
|
+
Other diseases of thymus
|
37
|
+
E23.7
|
38
|
+
Disorder of pituitary gland, unspecified
|
39
|
+
E32.1
|
40
|
+
Abscess of thymus
|
41
|
+
E32.9
|
42
|
+
Disease of thymus, unspecified
|
43
|
+
|
44
|
+
|
45
|
+
Table 87
|
46
|
+
Pre-admit test indicator
|
47
|
+
Code
|
48
|
+
Description
|
49
|
+
Y
|
50
|
+
Yes
|
51
|
+
N
|
52
|
+
No
|
53
|
+
|
54
|
+
|
55
|
+
Table 88
|
56
|
+
Procedure Code
|
57
|
+
Code
|
58
|
+
Description
|
59
|
+
00W000Z
|
60
|
+
Revision of Drainage Device in Brain, Open Approach
|
61
|
+
02110Z3
|
62
|
+
Bypass Coronary Artery, Two Sites from Coronary Artery, Open Approach
|
63
|
+
05500ZZ
|
64
|
+
Destruction of Azygos Vein, Open Approach
|
65
|
+
4A0004Z
|
66
|
+
Measurement of Central Nervous Electrical Activity, Open Approach
|
67
|
+
4A0204Z
|
68
|
+
Measurement of Cardiac Electrical Activity, Open Approach
|
69
|
+
4A060BZ
|
70
|
+
Measurement of Lymphatic Pressure, Open Approach
|
71
|
+
5A02110
|
72
|
+
Assistance with Cardiac Output using Balloon Pump, Intermittent
|
73
|
+
6A150ZZ
|
74
|
+
Decompression, Circulatory, Single
|
75
|
+
6A750Z4
|
76
|
+
Ultrasound Therapy of Head and Neck Vessels, Single
|
77
|
+
6A800ZZ
|
78
|
+
Ultraviolet Light Therapy of Skin, Single
|
79
|
+
|
80
|
+
|
81
|
+
Table 99
|
82
|
+
VIP indicator
|
83
|
+
Code
|
84
|
+
Description
|
85
|
+
Y
|
86
|
+
VIP
|
87
|
+
N
|
88
|
+
Non VIP
|
89
|
+
|
90
|
+
|
91
|
+
Table 113
|
92
|
+
Discharged to Location
|
93
|
+
Code
|
94
|
+
Description
|
95
|
+
1
|
96
|
+
Location 1
|
97
|
+
2
|
98
|
+
Location 2
|
99
|
+
3
|
100
|
+
Location 3
|
101
|
+
4
|
102
|
+
Location 4
|
103
|
+
5
|
104
|
+
Location 5
|
105
|
+
|
106
|
+
|
107
|
+
Table 115
|
108
|
+
Servicing facility
|
109
|
+
Code
|
110
|
+
Description
|
111
|
+
327
|
112
|
+
LOUISVILLE-RO
|
113
|
+
358
|
114
|
+
MANILA-RO
|
115
|
+
402
|
116
|
+
TOGUS VAMROC
|
117
|
+
405
|
118
|
+
WHITE RIVER JCT VAMROC
|
119
|
+
436
|
120
|
+
MONTANA HCS
|
121
|
+
437
|
122
|
+
FARGO VAMROC
|
123
|
+
438
|
124
|
+
SIOUX FALLS VAMROC
|
125
|
+
452
|
126
|
+
WICHITA-RO
|
127
|
+
|
128
|
+
|
129
|
+
Table 129
|
130
|
+
Accommodation code
|
131
|
+
Code
|
132
|
+
Description
|
133
|
+
1
|
134
|
+
ALLERGY
|
135
|
+
10
|
136
|
+
NEUROLOGY
|
137
|
+
2
|
138
|
+
CARDIOLOGY
|
139
|
+
20
|
140
|
+
REHABILITATION MEDICINE
|
141
|
+
24
|
142
|
+
MEDICAL OBSERVATION
|
143
|
+
25
|
144
|
+
PSYCH RESID REHAB TRMT PROG
|
145
|
+
40
|
146
|
+
INTERMEDIATE MEDICINE
|
147
|
+
50
|
148
|
+
GENERAL SURGERY
|
149
|
+
|
150
|
+
|
151
|
+
Table 152
|
152
|
+
Second opinion documentation received
|
153
|
+
Code
|
154
|
+
Description
|
155
|
+
Y
|
156
|
+
Documentation received
|
157
|
+
N
|
158
|
+
Documentation not received
|
159
|
+
|
160
|
+
|
161
|
+
Table 172
|
162
|
+
Veteran military status
|
163
|
+
Code
|
164
|
+
Description
|
165
|
+
Y
|
166
|
+
Veteran
|
167
|
+
N
|
168
|
+
Non Veteran
|
169
|
+
|
170
|
+
|
171
|
+
Table 212
|
172
|
+
Nationality
|
173
|
+
Code
|
174
|
+
Description
|
175
|
+
DEU
|
176
|
+
Germany
|
177
|
+
ESP
|
178
|
+
Spain
|
179
|
+
FRA
|
180
|
+
France
|
181
|
+
GBR
|
182
|
+
United Kingdom
|
183
|
+
ITA
|
184
|
+
Italy
|
185
|
+
USA
|
186
|
+
United States
|
187
|
+
|
188
|
+
|
189
|
+
Table 295
|
190
|
+
Handicap
|
191
|
+
Code
|
192
|
+
Description
|
193
|
+
Y
|
194
|
+
Yes
|
195
|
+
N
|
196
|
+
No
|
197
|
+
|
198
|
+
|
199
|
+
Table 296
|
200
|
+
Primary Language
|
201
|
+
Code
|
202
|
+
Description
|
203
|
+
EN
|
204
|
+
English
|
205
|
+
FR
|
206
|
+
French
|
207
|
+
ES
|
208
|
+
Spanish
|
209
|
+
DE
|
210
|
+
German
|
211
|
+
IT
|
212
|
+
Italian
|
213
|
+
|
214
|
+
|
215
|
+
Table 327
|
216
|
+
Job code/class
|
217
|
+
Code
|
218
|
+
Description
|
219
|
+
13-2011
|
220
|
+
Accountant
|
221
|
+
15-1132
|
222
|
+
Application Developer
|
223
|
+
23-1011
|
224
|
+
Attorney
|
225
|
+
29-1020
|
226
|
+
Dentist
|
227
|
+
29-1170
|
228
|
+
Nurse Practitioner
|
229
|
+
29-2041
|
230
|
+
Paramedic
|
231
|
+
29-1050
|
232
|
+
Pharmacist
|
233
|
+
29-1060
|
234
|
+
Physician
|
235
|
+
|
236
|
+
|
237
|
+
Table 340
|
238
|
+
Procedure Code modifier
|
239
|
+
Code
|
240
|
+
Description
|
241
|
+
57
|
242
|
+
Decision for surgery
|
243
|
+
23
|
244
|
+
Unusual Anesthesia
|
245
|
+
50
|
246
|
+
Bilateral Procedure
|
247
|
+
33
|
248
|
+
Preventive Service
|
249
|
+
51
|
250
|
+
Multiple Procedures
|
251
|
+
52
|
252
|
+
Reduced Services
|
253
|
+
|
254
|
+
|
255
|
+
Table 342
|
256
|
+
Military recipient
|
257
|
+
Code
|
258
|
+
Description
|
259
|
+
Y
|
260
|
+
Dependent
|
261
|
+
N
|
262
|
+
Non Dependent
|