Skip to content

Commit

Permalink
FI-3100: Update (g)(10) Certfication Test Kit Terminology Package to …
Browse files Browse the repository at this point in the history
…2024 Version (#570)

* Update terminology script to pull down 2024 UMLS files

* Fix vsac package version and check explicitly for full us core package name in fhir package manager

* Update fhir package manager to use package2 url for updated vsac package

* Update value sets yml file to include the VS bindings from US Core 7
  • Loading branch information
emichaud998 authored Oct 22, 2024
1 parent f2c7a12 commit fe9ab4a
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Inferno.logger.formatter = proc do |_severity, _datetime, _progname, message|
"#{message}\n"
end

default_version = '2023'
default_version = '2024'

namespace :terminology do |_argv|
desc 'download and execute UMLS terminology data'
Expand Down
2 changes: 1 addition & 1 deletion bin/create_umls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [ -n "$1" ]
then
version="$1"
else
version="2023"
version="2024"
fi

echo "Version: ${version}"
Expand Down
2 changes: 1 addition & 1 deletion bin/prepare_terminology.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [ -n "$1" ]
then
version="$1"
else
version="2023"
version="2024"
fi

temp_folder="tmp/terminology/${version}"
Expand Down
6 changes: 3 additions & 3 deletions bin/run_terminology.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ if [ -f /.dockerenv ]; then
fi
fi

./bin/prepare_terminology.sh 2023
./bin/prepare_terminology.sh 2024
bundle exec rake terminology:create_vs_validators["preferred"]
echo "$?"

if [ -n "$CLEANUP" ]
then
echo 'Deleting 2023 build files'
bundle exec rake terminology:cleanup_precursors["2023"]
echo 'Deleting 2024 build files'
bundle exec rake terminology:cleanup_precursors["2024"]
fi
10 changes: 5 additions & 5 deletions lib/inferno/terminology/expected_manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
- http://hl7.org/fhir/composition-status
- :url: http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-type
:file: hl7_org_fhir_us_core_ValueSet_us-core-documentreference-type.msgpack
:count: 11418
:count: 12002
:type: bloom
:code_systems:
- http://terminology.hl7.org/CodeSystem/v3-NullFlavor
Expand All @@ -134,7 +134,7 @@
- http://hl7.org/fhir/document-relationship-type
- :url: http://hl7.org/fhir/ValueSet/mimetypes
:file: hl7_org_fhir_ValueSet_mimetypes.msgpack
:count: 2503
:count: 2575
:type: bloom
:code_systems:
- urn:ietf:bcp:13
Expand Down Expand Up @@ -504,7 +504,7 @@
:code_systems: http://terminology.hl7.org/CodeSystem/v3-NullFlavor
- :url: http://loinc.org
:file: loinc_org.msgpack
:count: 287148
:count: 292887
:type: bloom
:code_systems: http://loinc.org
- :url: http://hl7.org/fhir/document-relationship-type
Expand All @@ -514,7 +514,7 @@
:code_systems: http://hl7.org/fhir/document-relationship-type
- :url: urn:ietf:bcp:13
:file: urn_ietf_bcp_13.msgpack
:count: 2503
:count: 2575
:type: bloom
:code_systems: urn:ietf:bcp:13
- :url: http://hl7.org/fhir/identifier-use
Expand Down Expand Up @@ -669,7 +669,7 @@
:code_systems: http://terminology.hl7.org/CodeSystem/observation-category
- :url: http://snomed.info/sct
:file: snomed_info_sct.msgpack
:count: 508538
:count: 517626
:type: bloom
:code_systems: http://snomed.info/sct
- :url: http://terminology.hl7.org/CodeSystem/data-absent-reason
Expand Down
17 changes: 13 additions & 4 deletions lib/inferno/terminology/fhir_package_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ module Terminology
module FHIRPackageManager
class << self
REGISTRY_SERVER_URL = 'https://packages.fhir.org'.freeze
US_CORE_7_PACKAGE_URL = 'https://hl7.org/fhir/us/core/STU7/package.tgz'.freeze
VSAC_18_PACKAGE_URL = 'https://packages2.fhir.org/packages/us.nlm.vsac/0.18.0'.freeze
REQUIRED_VSAC_VALUE_SET_URLS = [
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.114222.4.11.836',
'http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113883.1.11.14914',
Expand Down Expand Up @@ -44,10 +46,17 @@ class << self
#
# @param [String] package The FHIR Package
def get_package(package, destination, desired_types = [])
package_url = package
.split('#')
.prepend(REGISTRY_SERVER_URL)
.join('/')
package_url = case package
when 'hl7.fhir.us.core#7.0.0'
US_CORE_7_PACKAGE_URL
when 'us.nlm.vsac#0.18.0'
VSAC_18_PACKAGE_URL
else
package
.split('#')
.prepend(REGISTRY_SERVER_URL)
.join('/')
end

tar_file_name = "tmp/#{package.split('#').join('-')}.tgz"

Expand Down
3 changes: 2 additions & 1 deletion lib/inferno/terminology/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ def save_new_value_set_list
USCoreTestKit::USCoreV311::USCoreTestSuite.metadata +
USCoreTestKit::USCoreV400::USCoreTestSuite.metadata +
USCoreTestKit::USCoreV501::USCoreTestSuite.metadata +
USCoreTestKit::USCoreV610::USCoreTestSuite.metadata
USCoreTestKit::USCoreV610::USCoreTestSuite.metadata +
USCoreTestKit::USCoreV700::USCoreTestSuite.metadata

all_metadata =
all_metadata
Expand Down
3 changes: 2 additions & 1 deletion lib/inferno/terminology/tasks/download_fhir_terminology.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ def download_us_core
FHIRPackageManager.get_package('hl7.fhir.us.core#4.0.0', PACKAGE_DIR, ['ValueSet', 'CodeSystem'])
FHIRPackageManager.get_package('hl7.fhir.us.core#5.0.1', PACKAGE_DIR, ['ValueSet', 'CodeSystem'])
FHIRPackageManager.get_package('hl7.fhir.us.core#6.1.0', PACKAGE_DIR, ['ValueSet', 'CodeSystem'])
FHIRPackageManager.get_package('hl7.fhir.us.core#7.0.0', PACKAGE_DIR, ['ValueSet', 'CodeSystem'])
FHIRPackageManager.get_package(
'us.nlm.vsac#0.11.0', File.join(PACKAGE_DIR, 'vsac'), ['ValueSet', 'CodeSystem']
'us.nlm.vsac#0.18.0', File.join(PACKAGE_DIR, 'vsac'), ['ValueSet', 'CodeSystem']
)
end

Expand Down
3 changes: 2 additions & 1 deletion lib/inferno/terminology/tasks/download_umls.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class DownloadUMLS
'2020' => 'https://download.nlm.nih.gov/umls/kss/2020AB/umls-2020AB-full.zip',
'2021' => 'https://download.nlm.nih.gov/umls/kss/2021AA/umls-2021AA-full.zip',
'2022' => 'https://download.nlm.nih.gov/umls/kss/2022AA/umls-2022AA-full.zip',
'2023' => 'https://download.nlm.nih.gov/umls/kss/2023AA/umls-2023AA-full.zip'
'2023' => 'https://download.nlm.nih.gov/umls/kss/2023AA/umls-2023AA-full.zip',
'2024' => 'https://download.nlm.nih.gov/umls/kss/2024AA/umls-2024AA-full.zip'
}.freeze
TICKET_GRANTING_TICKET_URL = 'https://utslogin.nlm.nih.gov/cas/v1/api-key'.freeze

Expand Down
2 changes: 1 addition & 1 deletion lib/inferno/terminology/tasks/expand_value_set_to_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def run
# Before writing the JSON to a file at the end
end_vs = nil if type == 'json'

%w[2023].each do |version|
%w[2024].each do |version|
Loader.register_umls_db File.join(TEMP_DIR, version, 'umls.db')
Loader.load_value_sets_from_directory(PACKAGE_DIR, true)
vs = Repositories::ValueSets.new.find(value_set_url)
Expand Down
3 changes: 2 additions & 1 deletion lib/inferno/terminology/tasks/run_umls_jar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class RunUMLSJar
'2020' => 'inferno_2020.prop',
'2021' => 'inferno_2021.prop',
'2022' => 'inferno_2022.prop',
'2023' => 'inferno_2023.prop'
'2023' => 'inferno_2023.prop',
'2024' => 'inferno_2024.prop'
}.freeze

attr_reader :version
Expand Down
Loading

0 comments on commit fe9ab4a

Please sign in to comment.