Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #481 from onc-healthit/development
Browse files Browse the repository at this point in the history
Version 2.10.0
  • Loading branch information
radamson committed Aug 9, 2020
2 parents 49df3e6 + 1364e7b commit 426de06
Show file tree
Hide file tree
Showing 189 changed files with 21,157 additions and 6,009 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ tmp/*
.vscode/*
resources/terminology/*
sequence_coverage.csv
fhir-pgdata/
20 changes: 10 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.2.3)
activesupport (5.2.4.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -25,7 +25,7 @@ GEM
rake (< 13.0)
coderay (1.1.2)
colorize (0.8.1)
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.6)
crack (0.4.3)
safe_yaml (~> 1.0.0)
daemons (1.3.1)
Expand Down Expand Up @@ -101,7 +101,7 @@ GEM
date_time_precision (>= 0.8)
mime-types (>= 3.0)
nokogiri (>= 1.10.4)
fhir_models (4.0.2)
fhir_models (4.1.0)
bcp47 (>= 0.3)
date_time_precision (>= 0.8)
mime-types (>= 3.0)
Expand All @@ -115,26 +115,26 @@ GEM
http-accept (1.7.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
i18n (1.7.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.3)
json (1.8.6)
json_pure (1.8.6)
jwt (2.2.1)
kramdown (2.1.0)
method_source (0.9.2)
mime-types (3.3)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.0904)
mime-types-data (3.2020.0512)
mini_portile2 (2.4.0)
minitest (5.12.2)
minitest (5.14.1)
msgpack (1.3.1)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.1.1)
mustermann (1.0.3)
netrc (0.11.0)
nokogiri (1.10.4)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
oauth2 (1.4.1)
faraday (>= 0.8, < 0.16.0)
Expand Down Expand Up @@ -208,7 +208,7 @@ GEM
tilt (2.0.10)
time_difference (0.7.0)
activesupport (~> 5.1)
tzinfo (1.2.5)
tzinfo (1.2.7)
thread_safe (~> 0.1)
unf (0.1.4)
unf_ext
Expand Down Expand Up @@ -254,4 +254,4 @@ DEPENDENCIES
webmock

BUNDLED WITH
2.0.2
2.1.4
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ include_extras: true
badge_text: Community

# Resource validator options: must be one of "internal" or "external". external_resource_validator_url is only used if resource_validator is set to external.
resource_validator: internal
resource_validator: external
external_resource_validator_url: http://validator_service:4567

# module options: one or more must be set. The first option in the list will be checked by default
Expand Down
38 changes: 36 additions & 2 deletions create_umls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,42 @@ fi
echo 'Populating mrrel table'
sqlite3 umls.db ".import MRREL.pipe mrrel"

echo 'Dropping existing mrsat table'
sqlite3 umls.db "drop table if exists mrsat;"

echo 'Creating mrsat table'
sqlite3 umls.db "create table mrsat (
CUI char(8) NOT NULL,
LUI char(8),
SUI char(8),
METAUI varchar(20),
STYPE varchar(50) NOT NULL,
CODE varchar(50),
ATUI varchar(10) NOT NULL,
SATUI varchar(10),
ATN varchar(50),
SAB varchar(20) NOT NULL,
ATV varchar(1000) NOT NULL,
SUPPRESS char(1),
CVF int
);"

# Remove the last pipe from each line, and quote all the fields/escape double quotes
# Because MRSAT has stray unescaped quotes in one of the fields
if [ ! -e MRSAT.pipe ]
then
echo 'Removing last pipe from RRF'
sed 's/|$//' ./resources/terminology/umls_subset/MRSAT.RRF | sed $'s/"/""/g;s/[^|]*/"&"/g' > MRSAT.pipe
fi

echo 'Populating mrsat table'
sqlite3 umls.db ".import MRSAT.pipe mrsat"

echo 'Indexing mrsat(ATN,ATV)'
sqlite3 umls.db "create index idx_at on mrsat(ATN,ATV);"

echo 'Indexing mrconso(tty)'
sqlite3 umls.db "create index idx_tty on mrconso (tty);"
sqlite3 umls.db "create index idx_tty on mrconso(tty);"

echo 'Indexing mrrel(rel,sab)'
sqlite3 umls.db "create index idx_isa on mrrel(REL,SAB);"
Expand All @@ -78,4 +112,4 @@ echo 'Indexing mrconso(aui)'
sqlite3 umls.db "CREATE INDEX idx_aui ON mrconso(AUI);"

echo 'Analyzing Database'
sqlite3 umls.db "ANALYZE;"
sqlite3 umls.db "ANALYZE;"
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
bdt_service:
image: infernocommunity/inferno-bdt-service
validator_service:
image: infernocommunity/fhir-validator-wrapper
image: infernocommunity/fhir-validator-service
nginx_server:
image: nginx
volumes:
Expand Down
73 changes: 68 additions & 5 deletions generator/bdt/bdt-structure.json
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,69 @@
],
"path": "4"
},
{
"name": "Metadata",
"type": "group",
"children": [
{
"name": "CapabilityStatement",
"type": "group",
"children": [
{
"id": "CapabilityStatement-1",
"name": "The CapabilityStatement instantiates the bulk-data CapabilityStatement",
"description": "To declare conformance with this IG, a server <b>should</b> include the following URL in its own <code>CapabilityStatement.instantiates</code>: <a target=\"_blank\" href=\"https://build.fhir.org/ig/HL7/bulk-data/CapabilityStatement-bulk-data.html\">http://hl7.org/fhir/uv/bulkdata/CapabilityStatement/bulk-data</a>. The <code>CapabilityStatement</code> should contain something like:<pre>\"instantiates\": [\n \"http://hl7.org/fhir/uv/bulkdata/CapabilityStatement/bulk-data\"\n]</pre>",
"type": "test",
"path": "5.0.0"
},
{
"id": "CapabilityStatement-2",
"name": "Includes the token endpoint in the CapabilityStatement",
"description": "If a server requires SMART on FHIR authorization for access, its metadata <b>must</b> support automated discovery of OAuth2 endpoints by including a “complex” extension (that is, an extension with multiple components inside) on the <code>CapabilityStatement.rest.security</code> element. Any time a client sees this extension, it must be prepared to authorize using SMART’s OAuth2-based protocol.<br/> This test is expecting to find the in CapabilityStatement an entry like:<pre>\"rest\": [\n {\n \"mode\": \"server\",\n \"security\": {\n \"extension\": [\n {\n \"url\": \"http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris\",\n \"extension\": [\n {\n \"url\": \"token\",\n \"valueUri\": \"https://someserver.org/auth/token\"\n }\n ]\n }\n ]\n }\n }\n]</pre>Having a CapabilityStatement is optional for bulk data servers, unless they are also FHIR servers (which they typically are). However, missing a CapabilityStatement will generate a warning here. ",
"type": "test",
"path": "5.0.1"
},
{
"id": "CapabilityStatement-3",
"name": "Check if \"export\" operation is defined in the CapabilityStatement",
"description": "This test expects to find in the CapabilityStatement an entry like:<pre>\"rest\": [\n {\n \"operation\": [\n {\n \"name\" : \"export\"\n }\n ]\n }\n]</pre>",
"type": "test",
"path": "5.0.2"
},
{
"id": "CapabilityStatement-4",
"name": "Check if \"patient-export\" operation is defined in the CapabilityStatement",
"description": "This test expects to find in the CapabilityStatement an entry like:<pre>\"rest\": [\n {\n \"operation\": [\n {\n \"name\" : \"patient-export\"\n }\n ]\n }\n]</pre>",
"type": "test",
"path": "5.0.3"
},
{
"id": "CapabilityStatement-5",
"name": "Check if \"group-export\" operation is defined in the CapabilityStatement",
"description": "This test expects to find in the CapabilityStatement an entry like:<pre>\"rest\": [\n {\n \"operation\": [\n {\n \"name\" : \"group-export\"\n }\n ]\n }\n]</pre>",
"type": "test",
"path": "5.0.4"
}
],
"path": "5.0"
},
{
"name": "Well Known SMART Configuration",
"type": "group",
"children": [
{
"id": "WellKnownSmartConfiguration-1",
"name": "Includes token_endpoint definition",
"description": "This test verifies that the server provides a <code>/.well-known/smart-configuration</code> and that a <code>token_endpoint</code> property is declared within that file.",
"type": "test",
"path": "5.1.0"
}
],
"path": "5.1"
}
],
"path": "5"
},
{
"name": "Status Endpoint",
"type": "group",
Expand All @@ -586,24 +649,24 @@
"name": "Responds with 202 for active transaction IDs",
"description": "<p>The status endpoint should return <b>202</b> status code until the export is completed.</p>See <a target=\"_blank\" href=\"https://github.com/HL7/bulk-data/blob/master/spec/export/index.md#response---in-progress-status\">https://github.com/HL7/bulk-data/blob/master/spec/export/index.md#response---in-progress-status</a>",
"type": "test",
"path": "5.0"
"path": "6.0"
},
{
"id": "Status-02",
"name": "Replies properly in case of error",
"description": "Runs a set of assertions to verify that:<ul><li>The returned HTTP status code is 5XX</li><li>The server returns a FHIR OperationOutcome resource in JSON format</li></ul><p>Note that even if some of the requested resources cannot successfully be exported, the overall export operation MAY still succeed. In this case, the Response.error array of the completion response MUST be populated (see below) with one or more files in ndjson format containing FHIR OperationOutcome resources to indicate what went wrong.</p>See <a target=\"_blank\" href=\"https://github.com/HL7/bulk-data/blob/master/spec/export/index.md#response---error-status-1\">https://github.com/HL7/bulk-data/blob/master/spec/export/index.md#response---error-status-1</a>",
"type": "test",
"path": "5.1"
"path": "6.1"
},
{
"id": "Status-03",
"name": "Generates valid status response",
"description": "Runs a set of assertions to verify that:<ul><li>The status endpoint should return <b>200</b> status code when the export is completed</li><li>The status endpoint should respond with <b>JSON</b></li><li>The <code>expires</code> header (if set) must be valid date in the future</li><li>The JSON response contains <code>transactionTime</code> which is a valid <a target=\"_blank\" href=\"http://hl7.org/fhir/datatypes.html#instant\">FHIR instant</a></li><li>The JSON response contains the kick-off URL in <code>request</code> property</li><li>The JSON response contains <code>requiresAccessToken</code> boolean property</li><li>The JSON response contains an <code>output</code> array in which:<ul><li>Every item has valid <code>type</code> property</li><li>Every item has valid <code>url</code> property</li><li>Every item may a <code>count</code> number property</li></ul></li><li>The JSON response contains an <code>error</code> array in which:<ul><li>Every item has valid <code>type</code> property</li><li>Every item has valid <code>url</code> property</li><li>Every item may a <code>count</code> number property</li></ul></li></ul>",
"type": "test",
"path": "5.2"
"path": "6.2"
}
],
"path": "5"
"path": "6"
}
]
}
}
1 change: 1 addition & 0 deletions generator/bdt/bdt_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class BDTGenerator < Generator::Base
'Patient-level export' => 'Verify the system is capable of performing a Patient-Level Export that conforms to the SMART Bulk Data IG.',
'System-level export' => 'Verify the system is capable of performing a System-Level Export that conforms to the SMART Bulk Data IG.',
'Group-level export' => 'Verify the system is capable of performing a Group-Level Export that conforms to the SMART Bulk Data IG.',
'Metadata' => 'Verify the CapabilityStatement conforms to the SMART Bulk Data IG.',
'Status Endpoint' => 'Verify the status endpoint conforms to the SMART Bulk Data IG for Export.'
}.freeze

Expand Down
11 changes: 10 additions & 1 deletion generator/generator_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,17 @@ def load_resources

# We should consider using the native Ruby models instead of JSON
# There were problems with round-tripping certain SearchParameters though
new_resource_json = JSON.parse(File.read(resource))

begin
new_resource_json = JSON.parse(File.read(resource))
rescue JSON::ParserError
Inferno.logger.debug("Failed to parse JSON: #{resource}")
next
end

new_resource = FHIR.from_contents(File.read(resource))
next unless new_resource.present?

resource_by_path[resource_path(new_resource)] = new_resource_json
type = new_resource.class.name.demodulize
type = 'CapabilityStatement' if type == 'Conformance'
Expand Down

0 comments on commit 426de06

Please sign in to comment.