fhir_models 1.8.1 → 1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +4 -4
- data/lib/fhir_models/bootstrap/definitions.rb +26 -0
- data/lib/fhir_models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f63fd1e45f00d9ddd763c8bd87074dcbea16bcd
|
4
|
+
data.tar.gz: 40402e2767b979c0ba0895f85caf54b1f76710c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69fbd6289a072777c08576b9e0dcccf7a4ff473b6c69ffb4f5446bab55e86e578b772372de00ca2f96d5fc9a31e2c917ecb202411ddcb1433d758c8fa72d4742
|
7
|
+
data.tar.gz: 89589dc0288b88ecec29d4a458d0144b531b42b5a75b96754da9c0f09f28da5d40cc5f6aa7a70d751f1c62e573fc536d79ef0b612a3ed4accdbdd22e55b50c61
|
data/bin/console
CHANGED
@@ -7,8 +7,8 @@ require 'fhir_models'
|
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
8
8
|
|
9
9
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
require
|
11
|
-
Pry.start
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
require 'irb'
|
14
|
+
IRB.start
|
@@ -211,6 +211,32 @@ module FHIR
|
|
211
211
|
codes
|
212
212
|
end
|
213
213
|
|
214
|
+
# Get the "display" (human-readable title) for a given code in a code system (uri)
|
215
|
+
# If one can't be found, return nil
|
216
|
+
def self.get_display(uri, code)
|
217
|
+
return nil if uri.nil? || code.nil?
|
218
|
+
load_expansions
|
219
|
+
valuesets = @@expansions.select { |x| x['compose']['include'].detect {|i| i['system'] == uri } }
|
220
|
+
valuesets += @@valuesets.select { |x| x['url'] == uri }
|
221
|
+
code_hash = nil
|
222
|
+
valuesets.each do |valueset|
|
223
|
+
if !valueset['expansion'].nil? && !valueset['expansion']['contains'].nil?
|
224
|
+
code_hash = valueset['expansion']['contains'].select { |x| x['system'] == uri && x['code'] == code}.first
|
225
|
+
elsif !valueset['compose'].nil? && !valueset['compose']['include'].nil?
|
226
|
+
included_systems = valueset['compose']['include'].map { |x| x['system'] }.uniq
|
227
|
+
systems = @@valuesets.select { |x| x['resourceType'] == 'CodeSystem' && included_systems.include?(x['url']) }
|
228
|
+
systems.each do |x|
|
229
|
+
code_hash = x['concept'].select { |con| con['url'] == uri && con['code'] == code }.first if x['concept']
|
230
|
+
break if code_hash
|
231
|
+
end
|
232
|
+
elsif valueset['concept']
|
233
|
+
code_hash = valueset['concept'].select { |v| v['code'] == code }.first
|
234
|
+
end
|
235
|
+
break if code_hash
|
236
|
+
end
|
237
|
+
code_hash['display'] if code_hash
|
238
|
+
end
|
239
|
+
|
214
240
|
# ----------------------------------------------------------------
|
215
241
|
# Search Params
|
216
242
|
# ----------------------------------------------------------------
|
data/lib/fhir_models/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fhir_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Walonoski
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2017-01-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|